From a578c1487759d2aca1b747ad6c9ede6acb8675ad Mon Sep 17 00:00:00 2001 From: Axel Le Bourhis <45206070+axelnxp@users.noreply.github.com> Date: Tue, 17 Sep 2024 18:56:00 +0200 Subject: [PATCH 01/47] [NXP][zephyr] Migrate to NXP Zephyr 3.7 downstream release (#35600) * [NXP][zephyr] Migrate to NXP Zephyr 3.7 downstream release - Kconfig/CMake updates for 3.7 - Optimize some stack sizes to reduce RAM footprint - Optimize net configuration to reduce ram footprint - Doc update - Remove overlays from platform folders - Workflows docker image updated to latest (depends on [NXP] Migrate docker image to NXP Zephyr 3.7 downstream release #35599) - Fixed NXP Zephyr examples build with VS Code image Signed-off-by: Axel Le Bourhis * Restyled by prettier-markdown * [NXP] Add 'zsdk' to wordlist for spellchecker Signed-off-by: Axel Le Bourhis * [Crypto] Fix build warning/error related to unused function Signed-off-by: Axel Le Bourhis * [NXP] Unset ZEPHYR_TOOLCHAIN_VARIANT using the shell commands To be able to track shell commands needed to build an example with `--dry-run`, any environment manipulation shall be done with shell commands and not using Python specific commands. --------- Signed-off-by: Axel Le Bourhis Co-authored-by: Restyled.io --- .github/.wordlist.txt | 1 + .github/workflows/bloat_check.yaml | 2 +- .github/workflows/build.yaml | 10 +-- .github/workflows/chef.yaml | 10 +-- .github/workflows/doxygen.yaml | 2 +- .github/workflows/examples-ameba.yaml | 4 +- .github/workflows/examples-asr.yaml | 4 +- .github/workflows/examples-bouffalolab.yaml | 2 +- .github/workflows/examples-cc13xx_26xx.yaml | 2 +- .github/workflows/examples-cc32xx.yaml | 4 +- .github/workflows/examples-efr32.yaml | 2 +- .github/workflows/examples-esp32.yaml | 8 +- .github/workflows/examples-infineon.yaml | 4 +- .github/workflows/examples-linux-arm.yaml | 4 +- .github/workflows/examples-linux-imx.yaml | 4 +- .../workflows/examples-linux-standalone.yaml | 4 +- .../examples-linux-tv-casting-app.yaml | 2 +- .github/workflows/examples-mw320.yaml | 4 +- .github/workflows/examples-nrfconnect.yaml | 2 +- .github/workflows/examples-nuttx.yaml | 2 +- .github/workflows/examples-nxp.yaml | 12 +-- .github/workflows/examples-openiotsdk.yaml | 2 +- .github/workflows/examples-qpg.yaml | 4 +- .github/workflows/examples-stm32.yaml | 2 +- .github/workflows/examples-telink.yaml | 4 +- .github/workflows/examples-tizen.yaml | 2 +- .github/workflows/full-android.yaml | 4 +- .github/workflows/fuzzing-build.yaml | 4 +- .github/workflows/java-tests.yaml | 12 +-- .github/workflows/minimal-build.yaml | 4 +- .github/workflows/qemu.yaml | 2 +- .github/workflows/release_artifacts.yaml | 4 +- .github/workflows/smoketest-android.yaml | 6 +- .github/workflows/tests.yaml | 4 +- .github/workflows/unit_integration_test.yaml | 2 +- .github/workflows/zap_regeneration.yaml | 4 +- .github/workflows/zap_templates.yaml | 4 +- config/nxp/app/enable-gnu-std.cmake | 26 +++---- config/nxp/app/pre-zephyr.cmake | 6 -- config/nxp/chip-module/CMakeLists.txt | 12 +-- config/nxp/chip-module/Kconfig.defaults | 74 +++++++++++++------ config/nxp/chip-module/Kconfig.features | 15 ++-- config/zephyr/Kconfig | 4 +- .../nxp/nxp_zephyr_ota_software_update.md | 5 +- .../all-clusters-app/nxp/zephyr/README.md | 35 +++++---- .../nxp/zephyr/boards/rd_rw612_bga.overlay | 52 +++++++++++++ examples/all-clusters-app/nxp/zephyr/prj.conf | 3 +- .../nxp/zephyr/prj_fdata.conf | 1 - .../nxp/zephyr/boards/rd_rw612_bga.overlay | 52 +++++++++++++ .../laundry-washer-app/nxp/zephyr/prj.conf | 3 +- .../nxp/zephyr/prj_fdata.conf | 1 - .../nxp/zephyr/boards/rd_rw612_bga.overlay | 52 +++++++++++++ examples/thermostat/nxp/zephyr/prj.conf | 3 +- examples/thermostat/nxp/zephyr/prj_fdata.conf | 1 - scripts/build/builders/nxp.py | 1 + src/crypto/PSASessionKeystore.cpp | 2 + src/platform/Zephyr/wifi/WiFiManager.cpp | 14 +--- .../nxp/zephyr/CHIPDevicePlatformConfig.h | 6 ++ .../boards/rd_rw612_bga/rd_rw612_bga.overlay | 68 ----------------- .../nxp/zephyr/nxp-zephyr-mbedtls-config.h | 2 +- 60 files changed, 354 insertions(+), 237 deletions(-) delete mode 100644 src/platform/nxp/zephyr/boards/rd_rw612_bga/rd_rw612_bga.overlay diff --git a/.github/.wordlist.txt b/.github/.wordlist.txt index 31955b6c9ad617..d0d8c0d9655462 100644 --- a/.github/.wordlist.txt +++ b/.github/.wordlist.txt @@ -1627,3 +1627,4 @@ zhengyaohan Zigbee zigbeealliance zigbeethread +zsdk diff --git a/.github/workflows/bloat_check.yaml b/.github/workflows/bloat_check.yaml index dc9eaa40f7e4ba..b9e1b7b891ffdc 100644 --- a/.github/workflows/bloat_check.yaml +++ b/.github/workflows/bloat_check.yaml @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 steps: - name: Checkout diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 0617b05d657008..e7e5073ec54b02 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -42,7 +42,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -138,7 +138,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -283,7 +283,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -346,7 +346,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -457,7 +457,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/chef.yaml b/.github/workflows/chef.yaml index 07f4cac37cc008..a3af1d83649bc4 100644 --- a/.github/workflows/chef.yaml +++ b/.github/workflows/chef.yaml @@ -27,7 +27,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: chef_linux: name: Chef - Linux CI Examples @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 options: --user root steps: @@ -56,7 +56,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:76 + image: ghcr.io/project-chip/chip-build-esp32:77 options: --user root steps: @@ -77,7 +77,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nrf-platform:76 + image: ghcr.io/project-chip/chip-build-nrf-platform:77 options: --user root steps: @@ -98,7 +98,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-telink:76 + image: ghcr.io/project-chip/chip-build-telink:77 options: --user root steps: diff --git a/.github/workflows/doxygen.yaml b/.github/workflows/doxygen.yaml index 40bf2b9e8c1c96..f486995e8b261f 100644 --- a/.github/workflows/doxygen.yaml +++ b/.github/workflows/doxygen.yaml @@ -81,7 +81,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-doxygen:76 + image: ghcr.io/project-chip/chip-build-doxygen:77 if: github.actor != 'restyled-io[bot]' diff --git a/.github/workflows/examples-ameba.yaml b/.github/workflows/examples-ameba.yaml index b18f44ec9d9206..ef27d2252858dd 100644 --- a/.github/workflows/examples-ameba.yaml +++ b/.github/workflows/examples-ameba.yaml @@ -27,7 +27,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: ameba: name: Ameba @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ameba:76 + image: ghcr.io/project-chip/chip-build-ameba:77 options: --user root steps: diff --git a/.github/workflows/examples-asr.yaml b/.github/workflows/examples-asr.yaml index 46881ea4810a33..d61af7ea5f633d 100644 --- a/.github/workflows/examples-asr.yaml +++ b/.github/workflows/examples-asr.yaml @@ -27,7 +27,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: asr: name: ASR @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-asr:76 + image: ghcr.io/project-chip/chip-build-asr:77 options: --user root steps: diff --git a/.github/workflows/examples-bouffalolab.yaml b/.github/workflows/examples-bouffalolab.yaml index d3191c598b57a0..01935deba341bc 100644 --- a/.github/workflows/examples-bouffalolab.yaml +++ b/.github/workflows/examples-bouffalolab.yaml @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-bouffalolab:76 + image: ghcr.io/project-chip/chip-build-bouffalolab:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-cc13xx_26xx.yaml b/.github/workflows/examples-cc13xx_26xx.yaml index 22a1d727284247..6a9d5f024cf337 100644 --- a/.github/workflows/examples-cc13xx_26xx.yaml +++ b/.github/workflows/examples-cc13xx_26xx.yaml @@ -45,7 +45,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ti:76 + image: ghcr.io/project-chip/chip-build-ti:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-cc32xx.yaml b/.github/workflows/examples-cc32xx.yaml index c07313f82cb8d8..114bbf252fb6a0 100644 --- a/.github/workflows/examples-cc32xx.yaml +++ b/.github/workflows/examples-cc32xx.yaml @@ -31,7 +31,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: cc32xx: name: cc32xx @@ -43,7 +43,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-ti:76 + image: ghcr.io/project-chip/chip-build-ti:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-efr32.yaml b/.github/workflows/examples-efr32.yaml index 66b62945978077..2386585f170e87 100644 --- a/.github/workflows/examples-efr32.yaml +++ b/.github/workflows/examples-efr32.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-efr32:76 + image: ghcr.io/project-chip/chip-build-efr32:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-esp32.yaml b/.github/workflows/examples-esp32.yaml index 168b84ddc66779..43cd5de45a7d8b 100644 --- a/.github/workflows/examples-esp32.yaml +++ b/.github/workflows/examples-esp32.yaml @@ -27,7 +27,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: esp32: name: ESP32 @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:76 + image: ghcr.io/project-chip/chip-build-esp32:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" @@ -91,7 +91,7 @@ jobs: run: | rm -rf ./zzz_pregenerated mv scripts/codegen.py.renamed scripts/codegen.py - mv scripts/tools/zap/generate.py.renamed scripts/tools/zap/generate.py + mv scripts/tools/zap/generate.py.renamed scripts/tools/zap/generate.py - name: Build example All Clusters App(Target:ESP32C3) run: scripts/examples/esp_example.sh all-clusters-app sdkconfig.defaults.esp32c3 esp32c3 - name: Copy aside build products @@ -126,7 +126,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32:76 + image: ghcr.io/project-chip/chip-build-esp32:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-infineon.yaml b/.github/workflows/examples-infineon.yaml index f4547d86a71bcb..799b8f64ea0822 100644 --- a/.github/workflows/examples-infineon.yaml +++ b/.github/workflows/examples-infineon.yaml @@ -28,7 +28,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: infineon: name: Infineon examples building @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-infineon:76 + image: ghcr.io/project-chip/chip-build-infineon:77 env: # TODO: this should probably be part of the dockerfile itself CY_TOOLS_PATHS: /opt/Tools/ModusToolbox/tools_3.2 diff --git a/.github/workflows/examples-linux-arm.yaml b/.github/workflows/examples-linux-arm.yaml index 8ea6b400f23b74..338fe3d7340458 100644 --- a/.github/workflows/examples-linux-arm.yaml +++ b/.github/workflows/examples-linux-arm.yaml @@ -27,7 +27,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: arm_crosscompile: name: Linux ARM Cross compile @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-crosscompile:76 + image: ghcr.io/project-chip/chip-build-crosscompile:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-linux-imx.yaml b/.github/workflows/examples-linux-imx.yaml index d1224852b734e9..dce469095b723c 100644 --- a/.github/workflows/examples-linux-imx.yaml +++ b/.github/workflows/examples-linux-imx.yaml @@ -27,7 +27,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: imx: name: Linux i.MX Build @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-imx:76 + image: ghcr.io/project-chip/chip-build-imx:77 steps: - name: Checkout diff --git a/.github/workflows/examples-linux-standalone.yaml b/.github/workflows/examples-linux-standalone.yaml index a3ca553632a956..0eff5db371300d 100644 --- a/.github/workflows/examples-linux-standalone.yaml +++ b/.github/workflows/examples-linux-standalone.yaml @@ -27,7 +27,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: linux_standalone: name: Linux Standalone @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-linux-tv-casting-app.yaml b/.github/workflows/examples-linux-tv-casting-app.yaml index 3159685f8f4704..f3ef14bf8a4905 100644 --- a/.github/workflows/examples-linux-tv-casting-app.yaml +++ b/.github/workflows/examples-linux-tv-casting-app.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 steps: - name: Checkout diff --git a/.github/workflows/examples-mw320.yaml b/.github/workflows/examples-mw320.yaml index 212bebfe3c70b9..bc2035c23b2fa3 100644 --- a/.github/workflows/examples-mw320.yaml +++ b/.github/workflows/examples-mw320.yaml @@ -27,7 +27,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: mw320: name: MW320 @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-nrfconnect.yaml b/.github/workflows/examples-nrfconnect.yaml index c9b16f36072295..48a94eef07c0ac 100644 --- a/.github/workflows/examples-nrfconnect.yaml +++ b/.github/workflows/examples-nrfconnect.yaml @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nrf-platform:76 + image: ghcr.io/project-chip/chip-build-nrf-platform:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-nuttx.yaml b/.github/workflows/examples-nuttx.yaml index 2de7f00e13dbd5..6be7cfb7d233ff 100644 --- a/.github/workflows/examples-nuttx.yaml +++ b/.github/workflows/examples-nuttx.yaml @@ -35,7 +35,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nuttx:76 + image: ghcr.io/project-chip/chip-build-nuttx:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-nxp.yaml b/.github/workflows/examples-nxp.yaml index 61291fc885e582..6fc6970ce2c51d 100644 --- a/.github/workflows/examples-nxp.yaml +++ b/.github/workflows/examples-nxp.yaml @@ -27,7 +27,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: k32w0: name: K32W0 @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-k32w:76 + image: ghcr.io/project-chip/chip-build-k32w:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -218,7 +218,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nxp:76 + image: ghcr.io/project-chip/chip-build-nxp:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: @@ -246,7 +246,7 @@ jobs: build \ --copy-artifacts-to out/artifacts \ " - + - name: Build RW61X thermostat example app run: | scripts/run_in_build_env.sh "\ @@ -257,7 +257,7 @@ jobs: build \ --copy-artifacts-to out/artifacts \ " - + - name: Build RW61X laundry-washer example app run: | scripts/run_in_build_env.sh "\ @@ -280,7 +280,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-nxp-zephyr:76 + image: ghcr.io/project-chip/chip-build-nxp-zephyr:77 steps: - name: Checkout diff --git a/.github/workflows/examples-openiotsdk.yaml b/.github/workflows/examples-openiotsdk.yaml index c1bf85860cb65e..bd95868be8028a 100644 --- a/.github/workflows/examples-openiotsdk.yaml +++ b/.github/workflows/examples-openiotsdk.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-openiotsdk:76 + image: ghcr.io/project-chip/chip-build-openiotsdk:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" options: --privileged diff --git a/.github/workflows/examples-qpg.yaml b/.github/workflows/examples-qpg.yaml index bd0ef01d7aba60..8b85f358b7e73e 100644 --- a/.github/workflows/examples-qpg.yaml +++ b/.github/workflows/examples-qpg.yaml @@ -27,7 +27,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: qpg: name: QPG @@ -39,7 +39,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-stm32.yaml b/.github/workflows/examples-stm32.yaml index 291b9264c626da..f018e32f3ba199 100644 --- a/.github/workflows/examples-stm32.yaml +++ b/.github/workflows/examples-stm32.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" steps: diff --git a/.github/workflows/examples-telink.yaml b/.github/workflows/examples-telink.yaml index f67da724ca0764..bcab5a1aa334eb 100644 --- a/.github/workflows/examples-telink.yaml +++ b/.github/workflows/examples-telink.yaml @@ -27,7 +27,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: telink: name: Telink @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-telink:76 + image: ghcr.io/project-chip/chip-build-telink:77 volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/examples-tizen.yaml b/.github/workflows/examples-tizen.yaml index abec382c564f43..3f4c68f35e7873 100644 --- a/.github/workflows/examples-tizen.yaml +++ b/.github/workflows/examples-tizen.yaml @@ -36,7 +36,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-tizen:76 + image: ghcr.io/project-chip/chip-build-tizen:77 options: --user root volumes: - "/tmp/bloat_reports:/tmp/bloat_reports" diff --git a/.github/workflows/full-android.yaml b/.github/workflows/full-android.yaml index 29822767571416..ccaf534b28a09e 100644 --- a/.github/workflows/full-android.yaml +++ b/.github/workflows/full-android.yaml @@ -26,7 +26,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: full_android: name: Run @@ -38,7 +38,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-android:76 + image: ghcr.io/project-chip/chip-build-android:77 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/fuzzing-build.yaml b/.github/workflows/fuzzing-build.yaml index 19e0bcdd2075ef..c70d750554c53e 100644 --- a/.github/workflows/fuzzing-build.yaml +++ b/.github/workflows/fuzzing-build.yaml @@ -24,7 +24,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: build_linux_fuzzing: name: Build on Linux @@ -33,7 +33,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/java-tests.yaml b/.github/workflows/java-tests.yaml index f585829f29f589..5dd637024642de 100644 --- a/.github/workflows/java-tests.yaml +++ b/.github/workflows/java-tests.yaml @@ -30,7 +30,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: java_tests_linux: name: Linux @@ -42,7 +42,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-java:76 + image: ghcr.io/project-chip/chip-build-java:77 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" @@ -101,7 +101,7 @@ jobs: "./scripts/build/build_examples.py \ --target linux-x64-kotlin-matter-controller \ build \ - " + " - name: Run Discover Commissionables Test run: | scripts/run_in_python_env.sh out/venv \ @@ -134,7 +134,7 @@ jobs: --tool-cluster "im" \ --tool-args "onnetwork-long-im-invoke --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ --factoryreset \ - ' + ' - name: Run IM Extendable Invoke Test run: | scripts/run_in_python_env.sh out/venv \ @@ -245,7 +245,7 @@ jobs: --tool-cluster "pairing" \ --tool-args "onnetwork-long --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 1000" \ --factoryreset \ - ' + ' - name: Run Kotlin IM Invoke Test run: | scripts/run_in_python_env.sh out/venv \ @@ -289,7 +289,7 @@ jobs: --tool-cluster "im" \ --tool-args "onnetwork-long-im-subscribe --nodeid 1 --setup-pin-code 20202021 --discriminator 3840 -t 3000" \ --factoryreset \ - ' + ' - name: Uploading core files uses: actions/upload-artifact@v4 if: ${{ failure() && !env.ACT }} diff --git a/.github/workflows/minimal-build.yaml b/.github/workflows/minimal-build.yaml index a3cdc697f9ef3d..4866f9ebd16523 100644 --- a/.github/workflows/minimal-build.yaml +++ b/.github/workflows/minimal-build.yaml @@ -33,7 +33,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-minimal:76 + image: ghcr.io/project-chip/chip-build-minimal:77 steps: - name: Checkout @@ -55,7 +55,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-minimal:76 + image: ghcr.io/project-chip/chip-build-minimal:77 steps: - name: Checkout diff --git a/.github/workflows/qemu.yaml b/.github/workflows/qemu.yaml index 8e1ab281803e0e..bff7dcfb4373c9 100644 --- a/.github/workflows/qemu.yaml +++ b/.github/workflows/qemu.yaml @@ -40,7 +40,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-esp32-qemu:76 + image: ghcr.io/project-chip/chip-build-esp32-qemu:77 volumes: - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/release_artifacts.yaml b/.github/workflows/release_artifacts.yaml index e4fc02b77a2e16..70d63c0431f64f 100644 --- a/.github/workflows/release_artifacts.yaml +++ b/.github/workflows/release_artifacts.yaml @@ -32,7 +32,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-esp32:76 + image: ghcr.io/project-chip/chip-build-esp32:77 steps: - name: Checkout @@ -64,7 +64,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build-efr32:76 + image: ghcr.io/project-chip/chip-build-efr32:77 steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.github/workflows/smoketest-android.yaml b/.github/workflows/smoketest-android.yaml index bac25a017629e5..46a83a850c66b5 100644 --- a/.github/workflows/smoketest-android.yaml +++ b/.github/workflows/smoketest-android.yaml @@ -25,7 +25,7 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: android: name: Smoke Run - Android @@ -37,7 +37,7 @@ jobs: if: github.actor != 'restyled-io[bot]' container: - image: ghcr.io/project-chip/chip-build-android:76 + image: ghcr.io/project-chip/chip-build-android:77 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" @@ -73,7 +73,7 @@ jobs: ./scripts/run_in_build_env.sh \ "./scripts/build/build_examples.py --target android-arm64-tv-casting-app build" - name: Clean out build output - run: rm -rf ./out examples/tv-casting-app/android/App/app/libs/jniLibs/* examples/tv-casting-app/android/App/app/libs/*.jar + run: rm -rf ./out examples/tv-casting-app/android/App/app/libs/jniLibs/* examples/tv-casting-app/android/App/app/libs/*.jar - name: Build Android arm64-tv-server run: | ./scripts/run_in_build_env.sh \ diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 65ba9ac4114303..a9620b617e5938 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -49,7 +49,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=1 net.ipv6.conf.all.forwarding=1" @@ -455,7 +455,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 options: --privileged --sysctl "net.ipv6.conf.all.disable_ipv6=0 net.ipv4.conf.all.forwarding=0 net.ipv6.conf.all.forwarding=0" diff --git a/.github/workflows/unit_integration_test.yaml b/.github/workflows/unit_integration_test.yaml index db6e8e129b6693..7816c741c187f2 100644 --- a/.github/workflows/unit_integration_test.yaml +++ b/.github/workflows/unit_integration_test.yaml @@ -39,7 +39,7 @@ jobs: runs-on: ubuntu-latest container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 volumes: - "/:/runner-root-volume" - "/tmp/log_output:/tmp/test_logs" diff --git a/.github/workflows/zap_regeneration.yaml b/.github/workflows/zap_regeneration.yaml index 4a86caf18301e5..e8213e09d85428 100644 --- a/.github/workflows/zap_regeneration.yaml +++ b/.github/workflows/zap_regeneration.yaml @@ -23,14 +23,14 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: zap_regeneration: name: ZAP Regeneration runs-on: ubuntu-20.04 container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 defaults: run: shell: sh diff --git a/.github/workflows/zap_templates.yaml b/.github/workflows/zap_templates.yaml index 3eb7a5c60fb03c..85b7ffa78bdc2e 100644 --- a/.github/workflows/zap_templates.yaml +++ b/.github/workflows/zap_templates.yaml @@ -27,14 +27,14 @@ concurrency: env: CHIP_NO_LOG_TIMESTAMPS: true - + jobs: zap_templates: name: ZAP templates generation runs-on: ubuntu-20.04 container: - image: ghcr.io/project-chip/chip-build:76 + image: ghcr.io/project-chip/chip-build:77 defaults: run: shell: sh diff --git a/config/nxp/app/enable-gnu-std.cmake b/config/nxp/app/enable-gnu-std.cmake index a5a5c6c6aca10f..7e3cfa773778e0 100644 --- a/config/nxp/app/enable-gnu-std.cmake +++ b/config/nxp/app/enable-gnu-std.cmake @@ -1,22 +1,22 @@ # -# Copyright (c) 2024 Project CHIP Authors +# Copyright (c) 2024 Project CHIP Authors # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # add_library(gnu17 INTERFACE) target_compile_options(gnu17 - INTERFACE - $<$:-std=gnu++17> - -D_SYS__PTHREADTYPES_H_) + INTERFACE + $<$:-std=gnu++17> + -Wno-stringop-truncation) target_link_libraries(app PRIVATE gnu17) diff --git a/config/nxp/app/pre-zephyr.cmake b/config/nxp/app/pre-zephyr.cmake index 9dd1b2ae32c5bf..d71c474037dcce 100644 --- a/config/nxp/app/pre-zephyr.cmake +++ b/config/nxp/app/pre-zephyr.cmake @@ -13,9 +13,3 @@ # See the License for the specific language governing permissions and # limitations under the License. # - -# Automatically find overlays defined at platform level -# Those are usually used to change FLASH and RAM layouts -if (EXISTS ${CHIP_ROOT}/src/platform/nxp/zephyr/boards/${BOARD}/${BOARD}.overlay) - list(APPEND EXTRA_DTC_OVERLAY_FILE ${CHIP_ROOT}/src/platform/nxp/zephyr/boards/${BOARD}/${BOARD}.overlay) -endif() diff --git a/config/nxp/chip-module/CMakeLists.txt b/config/nxp/chip-module/CMakeLists.txt index f5cb1bf88a0fce..557cb6f8766a81 100644 --- a/config/nxp/chip-module/CMakeLists.txt +++ b/config/nxp/chip-module/CMakeLists.txt @@ -182,14 +182,7 @@ endif() # ============================================================================== # Define 'chip-ota-image' target for building CHIP OTA image # ============================================================================== -if(EXISTS "${CHIP_ROOT}/src/platform/nxp/zephyr/boards/${BOARD}/${BOARD}.overlay") - set(DTC_BOARD_OVERLAY "${CHIP_ROOT}/src/platform/nxp/zephyr/boards/${BOARD}/${BOARD}.overlay") -else() - set(DTC_BOARD_OVERLAY "") - message(STATUS "No board overlay found") -endif() - -if (CONFIG_CHIP_OTA_REQUESTOR) +if(CONFIG_CHIP_OTA_REQUESTOR) if(CONFIG_MCUBOOT_SIGNATURE_KEY_FILE STREQUAL "") set(ZEPHYR_OUTPUT_NAME "zephyr") else() @@ -201,7 +194,8 @@ if (CONFIG_CHIP_OTA_REQUESTOR) add_custom_target(build_mcuboot ALL COMMAND west build -b ${BOARD} -d build_mcuboot ${ZEPHYR_BASE}/../bootloader/mcuboot/boot/zephyr - -- -DOVERLAY_CONFIG=${GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE} -DEXTRA_DTC_OVERLAY_FILE=${DTC_BOARD_OVERLAY} + -- -DOVERLAY_CONFIG=${GLOBAL_BOOTLOADER_CONF_OVERLAY_FILE} + -DEXTRA_DTC_OVERLAY_FILE="${DTC_OVERLAY_FILE};${EXTRA_DTC_OVERLAY_FILE}" COMMAND cp ${PROJECT_BINARY_DIR}/../modules/connectedhomeip/build_mcuboot/zephyr/zephyr.bin ${PROJECT_BINARY_DIR}/zephyr.mcuboot.bin ) diff --git a/config/nxp/chip-module/Kconfig.defaults b/config/nxp/chip-module/Kconfig.defaults index 36a9934a6a63e1..ba9fe9b4d3f4ab 100644 --- a/config/nxp/chip-module/Kconfig.defaults +++ b/config/nxp/chip-module/Kconfig.defaults @@ -91,13 +91,13 @@ config POSIX_MAX_FDS # Application stack size config MAIN_STACK_SIZE - default 8192 + default 3072 config INIT_STACKS default y config NET_MGMT_EVENT_STACK_SIZE - default 2048 + default 1024 config NET_MGMT_EVENT_QUEUE_SIZE default 20 @@ -136,21 +136,27 @@ config NET_TC_TX_THREAD_BASE_PRIO config NET_TC_RX_THREAD_BASE_PRIO default 3 +config NET_TC_SKIP_FOR_HIGH_PRIO + default y + +config NET_CONTEXT_PRIORITY + default y + # Network buffers config NET_PKT_RX_COUNT - default 60 + default 14 config NET_PKT_TX_COUNT - default 40 + default 14 config NET_BUF_RX_COUNT - default 60 + default 36 config NET_BUF_TX_COUNT - default 80 + default 36 config NET_BUF_DATA_SIZE - default 1744 + default 256 # Bluetooth Low Energy configs @@ -205,7 +211,10 @@ config BT_BUF_ACL_TX_SIZE config BT_RX_STACK_SIZE default 2048 if NO_OPTIMIZATIONS && DEBUG - default 1600 + default 1700 + +config BT_LONG_WQ_STACK_SIZE + default 1024 config BT_DEVICE_NAME_GATT_WRITABLE bool @@ -232,6 +241,13 @@ config NVS_LOOKUP_CACHE_SIZE if CHIP_WIFI +choice NXP_WIFI_PART + default NXP_RW610 if SOC_SERIES_RW6XX +endchoice + +config ZVFS_OPEN_MAX + default 30 + choice SCHED_ALGORITHM default SCHED_MULTIQ endchoice @@ -240,12 +256,22 @@ choice LIBC_IMPLEMENTATION default NEWLIB_LIBC endchoice -choice WPA_SUPP_LOG_LEVEL_CHOICE - default WPA_SUPP_LOG_LEVEL_ERR +choice WIFI_NM_WPA_SUPPLICANT_LOG_LEVEL_CHOICE + default WIFI_NM_WPA_SUPPLICANT_LOG_LEVEL_INF endchoice -config WPA_SUPP_THREAD_STACK_SIZE - default 12288 +choice WIFI_NM_WPA_SUPPLICANT_CRYPTO_BACKEND + default WIFI_NM_WPA_SUPPLICANT_CRYPTO_ALT +endchoice + +config WIFI_NM_WPA_SUPPLICANT_THREAD_STACK_SIZE + default 6144 + +config WIFI_NM_WPA_SUPPLICANT_WQ_STACK_SIZE + default 5120 + +config WIFI_NM_WPA_SUPPLICANT_INF_MON + default n config SYSTEM_WORKQUEUE_STACK_SIZE default 2048 @@ -261,7 +287,7 @@ config NET_IF_MCAST_IPV6_ADDR_COUNT default 8 config NET_SOCKETS_POLL_MAX - default 8 + default 14 config NET_IPV4_FRAGMENT_MAX_COUNT default 3 @@ -276,7 +302,7 @@ config NET_IPV6_FRAGMENT_MAX_COUNT default 3 config NET_IPV6_FRAGMENT_MAX_PKT - default 7 + default 8 config NET_IPV6_FRAGMENT_TIMEOUT default 3 @@ -287,7 +313,7 @@ config NET_MAX_ROUTERS default 1 config NET_MAX_CONN - default 4 + default 10 config SHELL_STACK_SIZE default 2616 @@ -319,6 +345,9 @@ config MBEDTLS_ENTROPY_ENABLED config MBEDTLS_ZEPHYR_ENTROPY default y +config MBEDTLS_SSL_MAX_CONTENT_LEN + default 8192 + config MBEDTLS_ENABLE_HEAP default y @@ -343,13 +372,16 @@ config MBEDTLS_ECP_C config MBEDTLS_ECP_DP_SECP256R1_ENABLED default y +config CHIP_CRYPTO_PSA + default y + if CHIP_CRYPTO_PSA config MBEDTLS_PSA_CRYPTO_C default y -config WPA_SUPP_CRYPTO_MBEDTLS_PSA - default y if WPA_SUPP_CRYPTO +config WIFI_NM_WPA_SUPPLICANT_CRYPTO_MBEDTLS_PSA + default y if WIFI_NM_WPA_SUPPLICANT endif @@ -358,11 +390,11 @@ config MCUX_ELS_PKC if MCUX_ELS_PKC -config KSDK_MBEDTLS - default n - config MCUX_PSA_CRYPTO_DRIVER_ELS_PKC - default y if MBEDTLS_PSA_CRYPTO_C + default y if CHIP_CRYPTO_PSA + +config MCUX_PSA_CRYPTO_DRIVER_ELS_PKC_THREAD + default y if CHIP_CRYPTO_PSA config ENTROPY_GENERATOR default y diff --git a/config/nxp/chip-module/Kconfig.features b/config/nxp/chip-module/Kconfig.features index d8d194ccef2b41..4b387464aecab4 100644 --- a/config/nxp/chip-module/Kconfig.features +++ b/config/nxp/chip-module/Kconfig.features @@ -24,11 +24,16 @@ config CHIP_WIFI default y select WIFI select WIFI_NXP - select WPA_SUPP - select WPA_SUPP_AP - select WPA_SUPP_WPS - select WPA_SUPP_WPA3 - select WPA_SUPP_CRYPTO_ENTERPRISE + select WIFI_NM_WPA_SUPPLICANT + select WIFI_NM_WPA_SUPPLICANT_CRYPTO_ENTERPRISE + select WIFI_NM_WPA_SUPPLICANT_DPP + select WIFI_NM_WPA_SUPPLICANT_EAPOL + select WIFI_NM_WPA_SUPPLICANT_WPS + select NET_L2_ETHERNET + select NET_IPV4 + select NET_DHCPV4 + select DNS_RESOLVER + imply THREAD_CUSTOM_DATA imply MBEDTLS_ENTROPY_C imply NET_STATISTICS imply NET_PKT_TXTIME diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig index 2a3a2d5495bf96..06b1d6fa5f79ad 100644 --- a/config/zephyr/Kconfig +++ b/config/zephyr/Kconfig @@ -22,7 +22,7 @@ menuconfig CHIP imply REQUIRES_FULL_LIBC imply NEWLIB_LIBC_NANO imply CBPRINTF_LIBC_SUBSTS - imply POSIX_API if !ARCH_POSIX && !CHIP_NRF_PLATFORM && !CHIP_NXP_PLATFORM + imply POSIX_API if !ARCH_POSIX && !CHIP_NRF_PLATFORM imply EVENTFD if !ARCH_POSIX imply REBOOT imply ENTROPY_GENERATOR @@ -30,7 +30,7 @@ menuconfig CHIP imply NET_IPV6 imply NET_CONFIG_NEED_IPV6 imply NET_SOCKETS - imply NET_SOCKETS_POSIX_NAMES if !ARCH_POSIX && (CHIP_NRF_PLATFORM || CHIP_NXP_PLATFORM) + imply NET_SOCKETS_POSIX_NAMES if !ARCH_POSIX && CHIP_NRF_PLATFORM imply NETWORKING imply HWINFO imply FLASH diff --git a/docs/guides/nxp/nxp_zephyr_ota_software_update.md b/docs/guides/nxp/nxp_zephyr_ota_software_update.md index 805afb7741c944..9ae97d2d1291c1 100644 --- a/docs/guides/nxp/nxp_zephyr_ota_software_update.md +++ b/docs/guides/nxp/nxp_zephyr_ota_software_update.md @@ -33,7 +33,7 @@ The Flash is divided into different regions as follow : (candidate application). The size reserved for each partition can be found in -`src/platform/nxp/zephyr/boards/board.overlay`. +`/boards/.overlay`. Notes : @@ -41,8 +41,7 @@ Notes : binary, ensuring compatibility between the application and the controllers. - The sizes of the primary and secondary applications are provided as an example. The size can be changed by overriding the partitions located at - `board.overlay`.(example: - `src/platform/nxp/zephyr/boards/rd_rw612_bga.overlay`) + `.overlay`. ### MCUBoot Bootloader diff --git a/examples/all-clusters-app/nxp/zephyr/README.md b/examples/all-clusters-app/nxp/zephyr/README.md index 45f71ee76c077b..54a06c62c6214c 100644 --- a/examples/all-clusters-app/nxp/zephyr/README.md +++ b/examples/all-clusters-app/nxp/zephyr/README.md @@ -31,7 +31,9 @@ NXP/Zephyr SDK. The example supports: -- Matter over Wi-Fi +- Matter over Wi-Fi with BLE commissioning +- Matter OTA requestor +- Matter Factory Data The supported boards are: @@ -49,18 +51,21 @@ Prerequisites: - Follow instruction from [BUILDING.md](../../../../docs/guides/BUILDING.md) to setup the Matter environment - Follow instruction from - [Getting Started Guide](https://docs.zephyrproject.org/latest/develop/getting_started/index.html) + [Getting Started Guide](https://docs.zephyrproject.org/3.7.0/develop/getting_started/index.html) to setup a Zephyr workspace, however, the west init command to use is as follows: ```shell -$ west init zephyrproject -m https://github.com/nxp-zephyr-ear/zephyr.git --mr zephyr_rw61x_v3.6_RFP +$ west init zephyrproject -m https://github.com/nxp-zephyr/nxp-zsdk.git --mr nxp-v3.7.0 ``` -> **Note**: Currently, supported NXP platforms in Zephyr targeting Matter are -> not available in the official Zephyr repo, you'll have to use the NXP fork -> `https://github.com/nxp-zephyr-ear/zephyr` github repo. Reach to your NXP -> contact for more details. +> **Note**: While some of NXP platforms are supported in Zephyr upstream, we +> recommend using nxp-zsdk downstream to get access to all NXP features that are +> not upstream yet. While you can decide to use nxp-zsdk top of tree, we +> recommend using a proper release tag delivered by NXP. This will ensure a +> certain level of quality of the nxp-zsdk in use. Currently, we highly +> recommend using the `nxp-v3.7.0` tag, based on Zephyr 3.7 LTS release. Reach +> to your NXP contact for more details. Steps to build the example, targeting `rd_rw612_bga` board: @@ -79,15 +84,17 @@ source /zephyr-env.sh 3. Run west build command: ```shell -west build -b rd_rw612_bga -p +west build -b rd_rw612_bga -p auto -d build_zephyr ``` -By default, a folder `build` will be created in the same folder you run the -command from. The binaries will be created in `build/zephyr` with the name -`zephyr.elf` and `zephyr.bin`. +A folder `build_zephyr` will be created in the same folder you run the command +from. The binaries will be created in `build_zephyr/zephyr` with the name +`zephyr.elf` and `zephyr.bin`. We recommend using the `-d build_zephyr` if you +are building from Matter repo root folder as a build folder already exists and +is tracked by git. You can get more details on `west build` with -[Zephyr's building guide](https://docs.zephyrproject.org/latest/develop/west/build-flash-debug.html#building-west-build) +[Zephyr's building guide](https://docs.zephyrproject.org/3.7.0/develop/west/build-flash-debug.html#building-west-build) @@ -102,7 +109,7 @@ west flash -i ``` You can get more details on `west flash` with -[Zephyr's flashing guide](https://docs.zephyrproject.org/latest/develop/west/build-flash-debug.html#flashing-west-flash) +[Zephyr's flashing guide](https://docs.zephyrproject.org/3.7.0/develop/west/build-flash-debug.html#flashing-west-flash) > **Note**: `west flash` will not start a debug session, it will only flash and > reset the device @@ -113,7 +120,7 @@ To debug a Matter with Zephyr application, you could use several methods: - [MCUXpresso IDE (version >= 11.6.0)](https://www.nxp.com/design/software/development-software/mcuxpresso-software-and-tools-/mcuxpresso-integrated-development-environment-ide:MCUXpresso-IDE) - `west debug` - [Zephyr's debugging guide](https://docs.zephyrproject.org/latest/develop/west/build-flash-debug.html#id29) + [Zephyr's debugging guide](https://docs.zephyrproject.org/3.7.0/develop/west/build-flash-debug.html#id29) > **Note**: As the build provides an elf file, any compatible debugging tool can > be used. diff --git a/examples/all-clusters-app/nxp/zephyr/boards/rd_rw612_bga.overlay b/examples/all-clusters-app/nxp/zephyr/boards/rd_rw612_bga.overlay index 86bb20739527cd..41ba4fc5cd304e 100644 --- a/examples/all-clusters-app/nxp/zephyr/boards/rd_rw612_bga.overlay +++ b/examples/all-clusters-app/nxp/zephyr/boards/rd_rw612_bga.overlay @@ -37,3 +37,55 @@ pinctrl-0 = <&pinmux_flexcomm3_usart>; pinctrl-names = "default"; }; + +&sram { + #address-cells = <1>; + #size-cells = <1>; + + sram_data: memory@40000 { + compatible = "mmio-sram"; + reg = <0x40000 DT_SIZE_K(1216)>; + }; +}; + +/delete-node/ &boot_partition; +/delete-node/ &slot0_partition; +/delete-node/ &slot1_partition; +/delete-node/ &fw_storage; +/delete-node/ &storage_partition; + +&flexspi { + status = "okay"; + + mx25u51245g: mx25u51245g@0 { + status = "okay"; + + partitions { + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 DT_SIZE_K(128)>; + }; + + slot0_partition: partition@20000 { + label = "image-0"; + reg = <0x00020000 0x440000>; + }; + + slot1_partition: partition@460000 { + label = "image-1"; + reg = <0x00460000 0x440000>; + }; + + storage_partition: partition@3FEF000 { + label = "storage"; + reg = <0x03FEF000 DT_SIZE_K(64)>; + }; + + factory_partition: partition@3FFF000 { + label = "factory-data"; + reg = <0x03FFF000 DT_SIZE_K(4)>; + }; + + }; + }; +}; diff --git a/examples/all-clusters-app/nxp/zephyr/prj.conf b/examples/all-clusters-app/nxp/zephyr/prj.conf index 936bc5984f4f35..375c50c33da6bf 100644 --- a/examples/all-clusters-app/nxp/zephyr/prj.conf +++ b/examples/all-clusters-app/nxp/zephyr/prj.conf @@ -43,7 +43,6 @@ CONFIG_DEBUG_INFO=y CONFIG_DEBUG_THREAD_INFO=y # use this config if stepping during debug session is not consistent # CONFIG_NO_OPTIMIZATIONS=y -CONFIG_EXCEPTION_STACK_TRACE=y CONFIG_ASSERT=y # by default west will generate the full assembly output, which can take several minutes when binaries are large CONFIG_OUTPUT_DISASSEMBLY=n @@ -55,5 +54,5 @@ CONFIG_OUTPUT_DISASSEMBLY=n # enable Matter CLI CONFIG_CHIP_LIB_SHELL=y # enable NET commands if desired -#CONFIG_NET_SHELL=y +# CONFIG_NET_SHELL=y CONFIG_CHIP_STATISTICS=y diff --git a/examples/all-clusters-app/nxp/zephyr/prj_fdata.conf b/examples/all-clusters-app/nxp/zephyr/prj_fdata.conf index a82618a5f46078..7094aab1e6ba39 100644 --- a/examples/all-clusters-app/nxp/zephyr/prj_fdata.conf +++ b/examples/all-clusters-app/nxp/zephyr/prj_fdata.conf @@ -70,7 +70,6 @@ CONFIG_DEBUG_INFO=y CONFIG_DEBUG_THREAD_INFO=y # use this config if stepping during debug session is not consistent # CONFIG_NO_OPTIMIZATIONS=y -CONFIG_EXCEPTION_STACK_TRACE=y CONFIG_ASSERT=y # by default west will generate the full assembly output, which can take several minutes when binaries are large CONFIG_OUTPUT_DISASSEMBLY=n diff --git a/examples/laundry-washer-app/nxp/zephyr/boards/rd_rw612_bga.overlay b/examples/laundry-washer-app/nxp/zephyr/boards/rd_rw612_bga.overlay index 86bb20739527cd..41ba4fc5cd304e 100644 --- a/examples/laundry-washer-app/nxp/zephyr/boards/rd_rw612_bga.overlay +++ b/examples/laundry-washer-app/nxp/zephyr/boards/rd_rw612_bga.overlay @@ -37,3 +37,55 @@ pinctrl-0 = <&pinmux_flexcomm3_usart>; pinctrl-names = "default"; }; + +&sram { + #address-cells = <1>; + #size-cells = <1>; + + sram_data: memory@40000 { + compatible = "mmio-sram"; + reg = <0x40000 DT_SIZE_K(1216)>; + }; +}; + +/delete-node/ &boot_partition; +/delete-node/ &slot0_partition; +/delete-node/ &slot1_partition; +/delete-node/ &fw_storage; +/delete-node/ &storage_partition; + +&flexspi { + status = "okay"; + + mx25u51245g: mx25u51245g@0 { + status = "okay"; + + partitions { + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 DT_SIZE_K(128)>; + }; + + slot0_partition: partition@20000 { + label = "image-0"; + reg = <0x00020000 0x440000>; + }; + + slot1_partition: partition@460000 { + label = "image-1"; + reg = <0x00460000 0x440000>; + }; + + storage_partition: partition@3FEF000 { + label = "storage"; + reg = <0x03FEF000 DT_SIZE_K(64)>; + }; + + factory_partition: partition@3FFF000 { + label = "factory-data"; + reg = <0x03FFF000 DT_SIZE_K(4)>; + }; + + }; + }; +}; diff --git a/examples/laundry-washer-app/nxp/zephyr/prj.conf b/examples/laundry-washer-app/nxp/zephyr/prj.conf index ed59218a7da0e9..24890f7d442b8c 100644 --- a/examples/laundry-washer-app/nxp/zephyr/prj.conf +++ b/examples/laundry-washer-app/nxp/zephyr/prj.conf @@ -43,7 +43,6 @@ CONFIG_DEBUG_INFO=y CONFIG_DEBUG_THREAD_INFO=y # use this config if stepping during debug session is not consistent # CONFIG_NO_OPTIMIZATIONS=y -CONFIG_EXCEPTION_STACK_TRACE=y CONFIG_ASSERT=y # by default west will generate the full assembly output, which can take several minutes when binaries are large CONFIG_OUTPUT_DISASSEMBLY=n @@ -55,5 +54,5 @@ CONFIG_OUTPUT_DISASSEMBLY=n # enable Matter CLI CONFIG_CHIP_LIB_SHELL=y # enable NET commands if desired -#CONFIG_NET_SHELL=y +# CONFIG_NET_SHELL=y CONFIG_CHIP_STATISTICS=y diff --git a/examples/laundry-washer-app/nxp/zephyr/prj_fdata.conf b/examples/laundry-washer-app/nxp/zephyr/prj_fdata.conf index 986fc877aec5df..9ab620c0920da4 100644 --- a/examples/laundry-washer-app/nxp/zephyr/prj_fdata.conf +++ b/examples/laundry-washer-app/nxp/zephyr/prj_fdata.conf @@ -70,7 +70,6 @@ CONFIG_DEBUG_INFO=y CONFIG_DEBUG_THREAD_INFO=y # use this config if stepping during debug session is not consistent # CONFIG_NO_OPTIMIZATIONS=y -CONFIG_EXCEPTION_STACK_TRACE=y CONFIG_ASSERT=y # by default west will generate the full assembly output, which can take several minutes when binaries are large CONFIG_OUTPUT_DISASSEMBLY=n diff --git a/examples/thermostat/nxp/zephyr/boards/rd_rw612_bga.overlay b/examples/thermostat/nxp/zephyr/boards/rd_rw612_bga.overlay index 86bb20739527cd..41ba4fc5cd304e 100644 --- a/examples/thermostat/nxp/zephyr/boards/rd_rw612_bga.overlay +++ b/examples/thermostat/nxp/zephyr/boards/rd_rw612_bga.overlay @@ -37,3 +37,55 @@ pinctrl-0 = <&pinmux_flexcomm3_usart>; pinctrl-names = "default"; }; + +&sram { + #address-cells = <1>; + #size-cells = <1>; + + sram_data: memory@40000 { + compatible = "mmio-sram"; + reg = <0x40000 DT_SIZE_K(1216)>; + }; +}; + +/delete-node/ &boot_partition; +/delete-node/ &slot0_partition; +/delete-node/ &slot1_partition; +/delete-node/ &fw_storage; +/delete-node/ &storage_partition; + +&flexspi { + status = "okay"; + + mx25u51245g: mx25u51245g@0 { + status = "okay"; + + partitions { + boot_partition: partition@0 { + label = "mcuboot"; + reg = <0x00000000 DT_SIZE_K(128)>; + }; + + slot0_partition: partition@20000 { + label = "image-0"; + reg = <0x00020000 0x440000>; + }; + + slot1_partition: partition@460000 { + label = "image-1"; + reg = <0x00460000 0x440000>; + }; + + storage_partition: partition@3FEF000 { + label = "storage"; + reg = <0x03FEF000 DT_SIZE_K(64)>; + }; + + factory_partition: partition@3FFF000 { + label = "factory-data"; + reg = <0x03FFF000 DT_SIZE_K(4)>; + }; + + }; + }; +}; diff --git a/examples/thermostat/nxp/zephyr/prj.conf b/examples/thermostat/nxp/zephyr/prj.conf index 8bb5bd9f275756..a2fa69056d517e 100644 --- a/examples/thermostat/nxp/zephyr/prj.conf +++ b/examples/thermostat/nxp/zephyr/prj.conf @@ -43,7 +43,6 @@ CONFIG_DEBUG_INFO=y CONFIG_DEBUG_THREAD_INFO=y # use this config if stepping during debug session is not consistent # CONFIG_NO_OPTIMIZATIONS=y -CONFIG_EXCEPTION_STACK_TRACE=y CONFIG_ASSERT=y # by default west will generate the full assembly output, which can take several minutes when binaries are large CONFIG_OUTPUT_DISASSEMBLY=n @@ -55,5 +54,5 @@ CONFIG_OUTPUT_DISASSEMBLY=n # enable Matter CLI CONFIG_CHIP_LIB_SHELL=y # enable NET commands if desired -#CONFIG_NET_SHELL=y +# CONFIG_NET_SHELL=y CONFIG_CHIP_STATISTICS=y diff --git a/examples/thermostat/nxp/zephyr/prj_fdata.conf b/examples/thermostat/nxp/zephyr/prj_fdata.conf index ee559b42ed9a71..4694bd18021595 100644 --- a/examples/thermostat/nxp/zephyr/prj_fdata.conf +++ b/examples/thermostat/nxp/zephyr/prj_fdata.conf @@ -70,7 +70,6 @@ CONFIG_DEBUG_INFO=y CONFIG_DEBUG_THREAD_INFO=y # use this config if stepping during debug session is not consistent # CONFIG_NO_OPTIMIZATIONS=y -CONFIG_EXCEPTION_STACK_TRACE=y CONFIG_ASSERT=y # by default west will generate the full assembly output, which can take several minutes when binaries are large CONFIG_OUTPUT_DISASSEMBLY=n diff --git a/scripts/build/builders/nxp.py b/scripts/build/builders/nxp.py index 6a297cf8174d6a..cdf06ac8b244da 100644 --- a/scripts/build/builders/nxp.py +++ b/scripts/build/builders/nxp.py @@ -242,6 +242,7 @@ def generate(self): cmd = 'export ZEPHYR_SDK_INSTALL_DIR="$ZEPHYR_NXP_SDK_INSTALL_DIR"' cmd += '\nexport ZEPHYR_BASE="$ZEPHYR_NXP_BASE"' + cmd += '\nunset ZEPHYR_TOOLCHAIN_VARIANT' cmd += '\nwest build -p --cmake-only -b {board_name} -d {out_folder} {example_folder}{build_args}'.format( board_name=self.board.Name(self.os_env), diff --git a/src/crypto/PSASessionKeystore.cpp b/src/crypto/PSASessionKeystore.cpp index 68f8029211e480..ece38e74ffeda2 100644 --- a/src/crypto/PSASessionKeystore.cpp +++ b/src/crypto/PSASessionKeystore.cpp @@ -68,12 +68,14 @@ class HkdfKeyAttributes : public KeyAttributesBase HkdfKeyAttributes() : KeyAttributesBase(PSA_KEY_TYPE_DERIVE, PSA_ALG_HKDF(PSA_ALG_SHA_256), PSA_KEY_USAGE_DERIVE, 0) {} }; +#if CHIP_CONFIG_ENABLE_ICD_CIP void SetKeyId(Symmetric128BitsKeyHandle & key, psa_key_id_t newKeyId) { auto & KeyId = key.AsMutable(); KeyId = newKeyId; } +#endif } // namespace CHIP_ERROR PSASessionKeystore::CreateKey(const Symmetric128BitsKeyByteArray & keyMaterial, Aes128KeyHandle & key) diff --git a/src/platform/Zephyr/wifi/WiFiManager.cpp b/src/platform/Zephyr/wifi/WiFiManager.cpp index 6dbc4930314fb1..a0730c1fa168fd 100644 --- a/src/platform/Zephyr/wifi/WiFiManager.cpp +++ b/src/platform/Zephyr/wifi/WiFiManager.cpp @@ -316,16 +316,10 @@ CHIP_ERROR WiFiManager::GetNetworkStatistics(NetworkStatistics & stats) const stats.mPacketMulticastRxCount = data.multicast.rx; stats.mPacketMulticastTxCount = data.multicast.tx; -#if CONFIG_CHIP_NXP_PLATFORM - /* Zephyr 3.6 doesn't support the unicast stat in net_stats_wifi struct */ - stats.mPacketUnicastRxCount = data.pkts.rx - data.multicast.rx - data.broadcast.rx; - stats.mPacketUnicastRxCount = data.pkts.tx - data.multicast.tx - data.broadcast.tx; -#else - stats.mPacketUnicastRxCount = data.unicast.rx; - stats.mPacketUnicastTxCount = data.unicast.tx; -#endif - stats.mBeaconsSuccessCount = data.sta_mgmt.beacons_rx; - stats.mBeaconsLostCount = data.sta_mgmt.beacons_miss; + stats.mPacketUnicastRxCount = data.unicast.rx; + stats.mPacketUnicastTxCount = data.unicast.tx; + stats.mBeaconsSuccessCount = data.sta_mgmt.beacons_rx; + stats.mBeaconsLostCount = data.sta_mgmt.beacons_miss; return CHIP_NO_ERROR; } diff --git a/src/platform/nxp/zephyr/CHIPDevicePlatformConfig.h b/src/platform/nxp/zephyr/CHIPDevicePlatformConfig.h index 99f34137ed0418..30ecb9d3482d96 100644 --- a/src/platform/nxp/zephyr/CHIPDevicePlatformConfig.h +++ b/src/platform/nxp/zephyr/CHIPDevicePlatformConfig.h @@ -60,6 +60,12 @@ #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0 #endif +#ifdef CONFIG_CHIP_ETHERNET +#define CHIP_DEVICE_CONFIG_ENABLE_ETHERNET CONFIG_CHIP_ETHERNET +#else +#define CHIP_DEVICE_CONFIG_ENABLE_ETHERNET 0 +#endif + #ifdef CONFIG_BT #define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE CONFIG_BT #else diff --git a/src/platform/nxp/zephyr/boards/rd_rw612_bga/rd_rw612_bga.overlay b/src/platform/nxp/zephyr/boards/rd_rw612_bga/rd_rw612_bga.overlay deleted file mode 100644 index c4db68870c2d84..00000000000000 --- a/src/platform/nxp/zephyr/boards/rd_rw612_bga/rd_rw612_bga.overlay +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2023-2024 Project CHIP Authors - * All rights reserved. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http: //www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -&sram { - #address-cells = <1>; - #size-cells = <1>; - - sram_data: memory@20000000 { - compatible = "mmio-sram"; - reg = <0x20000000 DT_SIZE_K(1216)>; - }; -}; - -/delete-node/ &boot_partition; -/delete-node/ &slot0_partition; -/delete-node/ &slot1_partition; -/delete-node/ &fw_storage; -/delete-node/ &storage_partition; - -&flexspi { - status = "okay"; - - mx25u51245g: mx25u51245g@0 { - status = "okay"; - - partitions { - boot_partition: partition@0 { - label = "mcuboot"; - reg = <0x00000000 DT_SIZE_K(128)>; - }; - - slot0_partition: partition@20000 { - label = "image-0"; - reg = <0x00020000 0x440000>; - }; - - slot1_partition: partition@460000 { - label = "image-1"; - reg = <0x00460000 0x440000>; - }; - - storage_partition: partition@3FEF000 { - label = "storage"; - reg = <0x03FEF000 DT_SIZE_K(64)>; - }; - - factory_partition: partition@3FFF000 { - label = "factory-data"; - reg = <0x03FFF000 DT_SIZE_K(4)>; - }; - - }; - }; -}; diff --git a/src/platform/nxp/zephyr/nxp-zephyr-mbedtls-config.h b/src/platform/nxp/zephyr/nxp-zephyr-mbedtls-config.h index 4b9b0e857113d7..f5f44390cd5410 100644 --- a/src/platform/nxp/zephyr/nxp-zephyr-mbedtls-config.h +++ b/src/platform/nxp/zephyr/nxp-zephyr-mbedtls-config.h @@ -24,7 +24,7 @@ #define MBEDTLS_CIPHER_PADDING_PKCS7 -#if CONFIG_WIFI_NXP && CONFIG_WPA_SUPP +#if CONFIG_WIFI_NXP #include "wpa_supp_els_pkc_mbedtls_config.h" #endif /* CONFIG_WIFI_NXP && CONFIG_WPA_SUPP */ From 85b2fd3d1810bafdbe461df1a3271d3fb1911a66 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 17 Sep 2024 15:09:32 -0400 Subject: [PATCH 02/47] Sharing my local test runner script for `CI-like test app build and execution` (#35625) * Add a test runner for convenient python runs * Add some documentation * Restyle * Update requirements * Use local build platforms, to maybe be able to run under darwin * Use local build platforms, to maybe be able to run under darwin * Fix typos * More typo fixes * Restyle * Make platform name actually work * Restyled by prettier-markdown * Fix linter * Add license --------- Co-authored-by: Andrei Litvin Co-authored-by: Restyled.io --- docs/testing/python.md | 12 + scripts/tests/local.py | 786 +++++++++++++++++++++++++++++++++ scripts/tests/requirements.txt | 5 +- 3 files changed, 802 insertions(+), 1 deletion(-) create mode 100755 scripts/tests/local.py diff --git a/docs/testing/python.md b/docs/testing/python.md index ec358b8796403e..c631550b040082 100644 --- a/docs/testing/python.md +++ b/docs/testing/python.md @@ -637,6 +637,18 @@ format, use the `--load-from-env` flag with the `run_python_tests.py` runner. Ex: `scripts/run_in_python_env.sh out/venv './scripts/tests/run_python_test.py --load-from-env /tmp/test_env.yaml --script src/python_testing/TC_ICDM_2_1.py'` +## Running ALL or a subset of tests when changing application code + +`scripts/tests/local.py` is a wrapper that is able to build and run tests in a +single command. + +Example to compile all prerequisites and then running all python tests: + +``` +./scripts/tests/local.py build # will compile python in out/pyenv and ALL application prerequisites +./scripts/tests/local.py python-tests # Runs all python tests that are runnable in CI +``` + ## Defining the CI test arguments Below is the format of the structured environment definition comments: diff --git a/scripts/tests/local.py b/scripts/tests/local.py new file mode 100755 index 00000000000000..f44bdc2e546f34 --- /dev/null +++ b/scripts/tests/local.py @@ -0,0 +1,786 @@ +#!/usr/bin/env python3 + +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import enum +import fnmatch +import glob +import logging +import os +import platform +import shlex +import stat +import subprocess +import sys +import textwrap +import time +from dataclasses import dataclass +from typing import List + +import alive_progress +import click +import coloredlogs +import tabulate + +# We compile for the local architecture. Figure out what platform we need + + +def _get_native_machine_target(): + """ + Returns the build prefix for applications, such as 'linux-x64'. + """ + current_system_info = platform.uname() + arch = current_system_info.machine + if arch == 'x86_64': + arch = 'x64' + elif arch == 'i386' or arch == 'i686': + arch = 'x86' + elif arch in ('aarch64', 'aarch64_be', 'armv8b', 'armv8l'): + arch = 'arm64' + + return f"{current_system_info.system.lower()}-{arch}" + + +class BinaryRunner(enum.Enum): + """ + Enumeration describing a wrapper runner for an application. Useful for debugging + failures (i.e. running under memory validators or replayability for failures). + """ + + NONE = enum.auto() + RR = enum.auto() + VALGRIND = enum.auto() + + def execute_str(self, path: str): + if self == BinaryRunner.NONE: + return path + elif self == BinaryRunner.RR: + return f"rr record {path}" + elif self == BinaryRunner.VALGRIND: + return f"valgrind {path}" + + +__RUNNERS__ = { + "none": BinaryRunner.NONE, + "rr": BinaryRunner.RR, + "valgrind": BinaryRunner.VALGRIND, +} + +__LOG_LEVELS__ = { + "debug": logging.DEBUG, + "info": logging.INFO, + "warn": logging.WARN, + "fatal": logging.FATAL, +} + + +@dataclass +class ExecutionTimeInfo: + """ + Contains information about duration that a script took to run + """ + + script: str + duration_sec: float + + +# Top level command, groups all other commands for the purpose of having +# common command line arguments. +@click.group() +@click.option( + "--log-level", + default="INFO", + type=click.Choice(list(__LOG_LEVELS__.keys()), case_sensitive=False), + help="Determines the verbosity of script output", +) +def cli(log_level): + """ + Helper script design to make running tests localy simpler. Handles + application/prerequisite builds and execution of tests. + + The binary is designed to be run in the root checkout and will + compile things in `out/` and execute tests locally. + + These are examples for running "Python tests" + + \b + local.py build # builds python and applications + local.py python-tests # Runs ALL python tests + local.py python-tests --test-filter TC_FAN # Runs all *FAN* tests + + \b + local.py build-apps # Re-build applications (if only those changed) + local.py build-python # Re-build python module only + """ + coloredlogs.install( + level=__LOG_LEVELS__[log_level], fmt="%(asctime)s %(levelname)-7s %(message)s" + ) + + +def _with_activate(build_cmd: List[str]) -> List[str]: + """ + Given a bash command list, will generate a new command suitable for subprocess + with an execution of `scripts/activate.sh` prepended to it + """ + return [ + "bash", + "-c", + ";".join(["set -e", "source scripts/activate.sh", shlex.join(build_cmd)]), + ] + + +def _do_build_python(): + """ + Builds a python virtual environment into `out/venv` + """ + logging.info("Building python packages in out/venv ...") + subprocess.run( + ["./scripts/build_python.sh", "--install_virtual_env", "out/venv"], check=True + ) + + +def _do_build_apps(): + """ + Builds example python apps suitable for running all python_tests. + + This builds a LOT of apps (significant storage usage). + """ + logging.info("Building example apps...") + + target_prefix = _get_native_machine_target() + targets = [ + f"{target_prefix}-chip-tool-no-ble-clang-boringssl", + f"{target_prefix}-all-clusters-no-ble-clang-boringssl", + f"{target_prefix}-bridge-no-ble-clang-boringssl", + f"{target_prefix}-energy-management-no-ble-clang-boringssl", + f"{target_prefix}-lit-icd-no-ble-clang-boringssl", + f"{target_prefix}-lock-no-ble-clang-boringssl", + f"{target_prefix}-microwave-oven-no-ble-clang-boringssl", + f"{target_prefix}-ota-provider-no-ble-clang-boringssl", + f"{target_prefix}-ota-requestor-no-ble-clang-boringssl", + f"{target_prefix}-rvc-no-ble-clang-boringssl", + f"{target_prefix}-tv-app-no-ble-clang-boringssl", + f"{target_prefix}-network-manager-ipv6only-no-ble-clang-boringssl", + ] + + cmd = ["./scripts/build/build_examples.py"] + for target in targets: + cmd.append("--target") + cmd.append(target) + cmd.append("build") + + subprocess.run(_with_activate(cmd), check=True) + + +def _do_build_basic_apps(): + """ + Builds a minimal subset of test applications, specifically + all-clusters and chip-tool only, for basic tests. + """ + logging.info("Building example apps...") + target_prefix = _get_native_machine_target() + targets = [ + f"{target_prefix}-chip-tool-no-ble-clang-boringssl", + f"{target_prefix}-all-clusters-no-ble-clang-boringssl", + ] + + cmd = ["./scripts/build/build_examples.py"] + for target in targets: + cmd.append("--target") + cmd.append(target) + cmd.append("build") + + subprocess.run(_with_activate(cmd), check=True) + + +@cli.command() +def build_basic_apps(): + """Builds chip-tool and all-clusters app.""" + _do_build_basic_apps() + + +@cli.command() +def build_python(): + """ + Builds a python environment in out/pyenv. + + Generally used together with `python-tests`. + To re-build the python environment use `build-apps`. + To re-build both python and apps, use `build` + """ + _do_build_python() + + +@cli.command() +def build_apps(): + """ + Builds MANY apps used by python-tests. + + Generally used together with `python-tests`. + To re-build the python environment use `build-python`. + To re-build both python and apps, use `build` + """ + _do_build_apps() + + +@cli.command() +def build(): + """ + Builds both python and apps (same as build-python + build-apps) + + Generally used together with `python-tests`. + """ + _do_build_python() + _do_build_apps() + + +def _maybe_with_runner(script_name: str, path: str, runner: BinaryRunner): + """ + Constructs a "real" path to execute, which may be replacing the input + path with a wrapper script that executes things like valgrind or rr. + """ + if runner == BinaryRunner.NONE: + return path + + # create a separate runner script based on the app + script_name = f"out/{script_name}.sh" + with open(script_name, "wt") as f: + f.write( + textwrap.dedent( + f"""\ + #!/usr/bin/env bash + + {runner.execute_str(path)} + """ + ) + ) + st = os.stat(script_name) + os.chmod(script_name, st.st_mode | stat.S_IEXEC) + + return script_name + + +def _add_target_to_cmd(cmd, flag, path, runner): + """ + Handles the `--target` argument (or similar) to a command list. + + Specifically it figures out how to convert `path` into either itself or + execution via a `runner` script. + + cmd will get " " appended to it, where executable + is either the input path or a wrapper script to execute via the given + input runner. + """ + cmd.append(flag) + cmd.append(_maybe_with_runner(flag[2:].replace("-", "_"), path, runner)) + + +@cli.command() +@click.option( + "--test-filter", + default="*", + show_default=True, + help="Run only tests that match the given glob filter.", +) +@click.option( + "--from-filter", + default=None, + help="Start running from the test matching the given glob pattern (including the test that matches).", +) +@click.option( + "--from-skip-filter", + default=None, + help="Start from the first test matching the given glob, but skip the matching element (start right after).", +) +@click.option( + "--dry-run", + default=False, + is_flag=True, + show_default=True, + help="Don't actually execute the tests, just print out the command that would be run.", +) +@click.option( + "--show_timings", + default=False, + is_flag=True, + show_default=True, + help="At the end of the execution, show how many seconds each test took.", +) +@click.option( + "--runner", + default="none", + type=click.Choice(list(__RUNNERS__.keys()), case_sensitive=False), + help="Determines the verbosity of script output", +) +def python_tests( + test_filter, from_filter, from_skip_filter, dry_run, show_timings, runner +): + """ + Run python tests via `run_python_test.py` + + Constructs the run yaml in `out/test_env.yaml`. Assumes that binaries + were built already, generally with `build` (or separate `build-python` and `build-apps`). + """ + runner = __RUNNERS__[runner] + + def as_runner(path): + return _maybe_with_runner(os.path.basename(path), path, runner) + + # create an env file + target_prefix = _get_native_machine_target() + with open("out/test_env.yaml", "wt") as f: + f.write( + textwrap.dedent( + f"""\ + ALL_CLUSTERS_APP: {as_runner(f'out/{target_prefix}-all-clusters-no-ble-clang-boringssl/chip-all-clusters-app')} + CHIP_LOCK_APP: {as_runner(f'out/{target_prefix}-lock-no-ble-clang-boringssl/chip-lock-app')} + ENERGY_MANAGEMENT_APP: { + as_runner(f'out/{target_prefix}-energy-management-no-ble-clang-boringssl/chip-energy-management-app')} + LIT_ICD_APP: {as_runner(f'out/{target_prefix}-lit-icd-no-ble-clang-boringssl/lit-icd-app')} + CHIP_MICROWAVE_OVEN_APP: { + as_runner(f'out/{target_prefix}-microwave-oven-no-ble-clang-boringssl/chip-microwave-oven-app')} + CHIP_RVC_APP: {as_runner(f'out/{target_prefix}-rvc-no-ble-clang-boringssl/chip-rvc-app')} + NETWORK_MANAGEMENT_APP: { + as_runner(f'out/{target_prefix}-network-manager-ipv6only-no-ble-clang-boringssl/matter-network-manager-app')} + TRACE_APP: out/trace_data/app-{{SCRIPT_BASE_NAME}} + TRACE_TEST_JSON: out/trace_data/test-{{SCRIPT_BASE_NAME}} + TRACE_TEST_PERFETTO: out/trace_data/test-{{SCRIPT_BASE_NAME}} + """ + ) + ) + + if not test_filter.startswith("*"): + test_filter = "*" + test_filter + if not test_filter.endswith("*"): + test_filter = test_filter + "*" + + if from_filter: + if not from_filter.startswith("*"): + from_filter = "*" + from_filter + if not from_filter.endswith("*"): + from_filter = from_filter + "*" + + if from_skip_filter: + if not from_skip_filter.startswith("*"): + from_skip_filter = "*" + from_skip_filter + if not from_skip_filter.endswith("*"): + from_skip_filter = from_skip_filter + "*" + + # This MUST be available or perfetto dies. This is VERY annoying to debug + if not os.path.exists("out/trace_data"): + os.mkdir("out/trace_data") + + # IGNORES are taken out of `src/python_testing/execute_python_tests.py` in the SDK + excluded_patterns = { + "MinimalRepresentation.py", + "TC_CNET_4_4.py", + "TC_CCTRL_2_1.py", + "TC_CCTRL_2_2.py", + "TC_CCTRL_2_3.py", + "TC_DGGEN_3_2.py", + "TC_EEVSE_Utils.py", + "TC_ECOINFO_2_1.py", + "TC_ECOINFO_2_2.py", + "TC_EWATERHTRBase.py", + "TC_EWATERHTR_2_1.py", + "TC_EWATERHTR_2_2.py", + "TC_EWATERHTR_2_3.py", + "TC_EnergyReporting_Utils.py", + "TC_OpstateCommon.py", + "TC_pics_checker.py", + "TC_TMP_2_1.py", + "TC_MCORE_FS_1_1.py", + "TC_MCORE_FS_1_2.py", + "TC_MCORE_FS_1_3.py", + "TC_MCORE_FS_1_4.py", + "TC_MCORE_FS_1_5.py", + "TC_OCC_3_1.py", + "TC_OCC_3_2.py", + "TC_BRBINFO_4_1.py", + "TestCommissioningTimeSync.py", + "TestConformanceSupport.py", + "TestChoiceConformanceSupport.py", + "TC_DEMTestBase.py", + "choice_conformance_support.py", + "TestConformanceTest.py", # Unit test of the conformance test (TC_DeviceConformance) - does not run against an app. + "TestIdChecks.py", + "TestSpecParsingDeviceType.py", + "TestMatterTestingSupport.py", + "TestSpecParsingSupport.py", + "TestTimeSyncTrustedTimeSource.py", + "basic_composition_support.py", + "conformance_support.py", + "drlk_2_x_common.py", + "execute_python_tests.py", + "global_attribute_ids.py", + "hello_external_runner.py", + "hello_test.py", + "matter_testing_support.py", + "pics_support.py", + "spec_parsing_support.py", + "taglist_and_topology_test_support.py", + "test_plan_support.py", + "test_plan_table_generator.py", + } + + if not os.path.isdir("src/python_testing"): + raise Exception( + "Script meant to be run from the CHIP checkout root (src/python_testing must exist)." + ) + + test_scripts = [] + for file in glob.glob(os.path.join("src/python_testing/", "*.py")): + if os.path.basename(file) in excluded_patterns: + continue + test_scripts.append(file) + test_scripts.append("src/controller/python/test/test_scripts/mobile-device-test.py") + test_scripts.sort() # order consistent + + # NOTE: VERY slow tests. we add logs to not get impatient + slow_test_duration = { + "mobile-device-test.py": "3 minutes", + "TC_AccessChecker.py": "1.5 minutes", + "TC_CADMIN_1_9.py": "40 seconds", + "TC_CC_2_2.py": "1.5 minutes", + "TC_DEM_2_10.py": "40 seconds", + "TC_DeviceBasicComposition.py": "25 seconds", + "TC_DRLK_2_12.py": "30 seconds", + "TC_DRLK_2_3.py": "30 seconds", + "TC_EEVSE_2_6.py": "30 seconds", + "TC_FAN_3_1.py": "15 seconds", + "TC_OPSTATE_2_5.py": "1.25 minutes", + "TC_OPSTATE_2_6.py": "35 seconds", + "TC_PS_2_3.py": "30 seconds", + "TC_RR_1_1.py": "25 seconds", + "TC_SWTCH.py": "1 minute", + "TC_TIMESYNC_2_10.py": "20 seconds", + "TC_TIMESYNC_2_11.py": "30 seconds", + "TC_TIMESYNC_2_12.py": "20 seconds", + "TC_TIMESYNC_2_7.py": "20 seconds", + "TC_TIMESYNC_2_8.py": "1.5 minutes", + "TC_ICDM_5_1.py": "TODO", + } + + execution_times = [] + try: + to_run = [] + for script in fnmatch.filter(test_scripts, test_filter or "*.*"): + if from_filter: + if not fnmatch.fnmatch(script, from_filter): + logging.info("From-filter SKIP %s", script) + continue + from_filter = None + + if from_skip_filter: + if fnmatch.fnmatch(script, from_skip_filter): + from_skip_filter = None + logging.info("From-skip-filter SKIP %s", script) + continue + to_run.append(script) + + with alive_progress.alive_bar(len(to_run), title="Running tests") as bar: + for script in to_run: + bar.text(script) + cmd = [ + "scripts/run_in_python_env.sh", + "out/venv", + f"./scripts/tests/run_python_test.py --load-from-env out/test_env.yaml --script {script}", + ] + + if dry_run: + print(shlex.join(cmd)) + continue + + base_name = os.path.basename(script) + if base_name in slow_test_duration: + logging.warning( + "SLOW test '%s' is executing (expect to take around %s). Be patient...", + base_name, + slow_test_duration[base_name], + ) + elif base_name == "TC_EEVSE_2_3.py": + # TODO: this should be fixed ... + # for now just note that a `TZ=UTC` makes this pass + logging.warning( + "Test %s is TIMEZONE dependent. Passes with UTC but fails on EST. If this fails set 'TZ=UTC' for running the test.", + base_name, + ) + + tstart = time.time() + result = subprocess.run(cmd, capture_output=True) + tend = time.time() + + if result.returncode != 0: + logging.error("Test failed: %s", script) + logging.info("STDOUT:\n%s", result.stdout.decode("utf8")) + logging.warning("STDERR:\n%s", result.stderr.decode("utf8")) + sys.exit(1) + + time_info = ExecutionTimeInfo( + script=base_name, duration_sec=(tend - tstart) + ) + execution_times.append(time_info) + + if time_info.duration_sec > 20 and base_name not in slow_test_duration: + logging.warning( + "%s finished in %0.2f seconds", + time_info.script, + time_info.duration_sec, + ) + bar() + finally: + if execution_times and show_timings: + execution_times.sort(key=lambda v: v.duration_sec) + print( + tabulate.tabulate(execution_times, headers=["Script", "Duration(sec)"]) + ) + + +def _do_build_fabric_sync_apps(): + """ + Build applications used for fabric sync tests + """ + target_prefix = _get_native_machine_target() + targets = [ + f"{target_prefix}-fabric-bridge-boringssl-rpc-no-ble", + f"{target_prefix}-fabric-admin-boringssl-rpc", + f"{target_prefix}-all-clusters-boringssl-no-ble", + ] + + build_cmd = ["./scripts/build/build_examples.py"] + for target in targets: + build_cmd.append("--target") + build_cmd.append(target) + build_cmd.append("build") + + subprocess.run(_with_activate(build_cmd)) + + +@cli.command() +def build_fabric_sync_apps(): + """ + Build fabric synchronizatio applications. + """ + _do_build_fabric_sync_apps() + + +@cli.command() +def build_fabric_sync(): + """ + Builds both python environment and fabric sync applications + """ + # fabric sync interfaces with python for convenience, so do that + _do_build_python() + _do_build_fabric_sync_apps() + + +@cli.command() +@click.option( + "--data-model-interface", type=click.Choice(["enabled", "disabled", "check"]) +) +@click.option("--asan", is_flag=True, default=False, show_default=True) +def build_casting_apps(data_model_interface, asan): + """ + Builds Applications used for tv casting tests + """ + tv_args = [] + casting_args = [] + + casting_args.append("chip_casting_simplified=true") + + tv_args.append('chip_crypto="boringssl"') + casting_args.append('chip_crypto="boringssl"') + + if data_model_interface: + tv_args.append(f'chip_use_data_model_interface="{data_model_interface}"') + casting_args.append(f'chip_use_data_model_interface="{data_model_interface}"') + + if asan: + tv_args.append("is_asan=true is_clang=true") + casting_args.append("is_asan=true is_clang=true") + + tv_args = " ".join(tv_args) + casting_args = " ".join(casting_args) + + if tv_args: + tv_args = f" '{tv_args}'" + if casting_args: + casting_args = f" '{casting_args}'" + + cmd = ";".join( + [ + "set -e", + "source scripts/activate.sh", + f"./scripts/examples/gn_build_example.sh examples/tv-app/linux/ out/tv-app{tv_args}", + f"./scripts/examples/gn_build_example.sh examples/tv-casting-app/linux/ out/tv-casting-app{casting_args}", + ] + ) + subprocess.run(["bash", "-c", cmd], check=True) + + +@cli.command() +@click.option("--test", type=click.Choice(["basic", "passcode"]), default="basic") +@click.option("--log-directory", default=None) +@click.option( + "--tv-app", + type=str, + default="out/tv-app/chip-tv-app", +) +@click.option( + "--tv-casting-app", + type=str, + default="out/tv-casting-app/chip-tv-casting-app", +) +@click.option( + "--runner", + default="none", + type=click.Choice(list(__RUNNERS__.keys()), case_sensitive=False), + help="Determines the verbosity of script output", +) +def casting_test(test, log_directory, tv_app, tv_casting_app, runner): + """ + Runs the tv casting tests. + + Generally used after `build-casting-apps`. + """ + runner = __RUNNERS__[runner] + + script = "python3 scripts/tests/run_tv_casting_test.py" + + script += f" --tv-app-rel-path '{_maybe_with_runner('tv_app', tv_app, runner)}'" + script += f" --tv-casting-app-rel-path '{_maybe_with_runner('casting_app', tv_casting_app, runner)}'" + + if test == "passcode": + script += " --commissioner-generated-passcode true" + + if log_directory: + script += f" --log-directory '{log_directory}'" + + cmd = ";".join(["set -e", "source scripts/activate.sh", script]) + subprocess.run(["bash", "-c", cmd], check=True) + + +@cli.command() +@click.option("--target", default=None) +@click.option("--target-glob", default=None) +@click.option("--include-tags", default=None) +@click.option("--expected-failures", default=None) +@click.option( + "--runner", + default="none", + type=click.Choice(list(__RUNNERS__.keys()), case_sensitive=False), + help="Determines the verbosity of script output", +) +def chip_tool_tests(target, target_glob, include_tags, expected_failures, runner): + """ + Run integration tests using chip-tool. + + Assumes `build-apps` was used to build applications, although build-basic-apps will be + sufficient for all-clusters tests. + """ + + # This likely should be run in docker to not allow breaking things + # run as: + # + # docker run --rm -it -v ~/devel/connectedhomeip:/workspace --privileged ghcr.io/project-chip/chip-build-vscode:64 + runner = __RUNNERS__[runner] + + cmd = [ + "./scripts/tests/run_test_suite.py", + "--runner", + "chip_tool_python", + ] + + target_prefix = _get_native_machine_target() + cmd.extend( + ["--chip-tool", f"./out/{target_prefix}-chip-tool-no-ble-clang-boringssl/chip-tool"] + ) + + if target is not None: + cmd.extend(["--target", target]) + + if include_tags is not None: + cmd.extend(["--include-tags", include_tags]) + + if target_glob is not None: + cmd.extend(["--target-glob", target_glob]) + + cmd.append("run") + cmd.extend(["--iterations", "1"]) + cmd.extend(["--test-timeout-seconds", "60"]) + + if expected_failures is not None: + cmd.extend(["--expected-failures", expected_failures, "--keep-going"]) + + _add_target_to_cmd( + cmd, + "--all-clusters-app", + f"./out/{target_prefix}-all-clusters-no-ble-clang-boringssl/chip-all-clusters-app", + runner, + ) + _add_target_to_cmd( + cmd, + "--lock-app", + f"./out/{target_prefix}-lock-no-ble-clang-boringssl/chip-lock-app", + runner, + ) + _add_target_to_cmd( + cmd, + "--ota-provider-app", + f"./out/{target_prefix}-ota-provider-no-ble-clang-boringssl/chip-ota-provider-app", + runner, + ) + _add_target_to_cmd( + cmd, + "--ota-requestor-app", + f"./out/{target_prefix}-ota-requestor-no-ble-clang-boringssl/chip-ota-requestor-app", + runner, + ) + _add_target_to_cmd( + cmd, + "--tv-app", + f"./out/{target_prefix}-tv-app-no-ble-clang-boringssl/chip-tv-app", + runner, + ) + _add_target_to_cmd( + cmd, + "--bridge-app", + f"./out/{target_prefix}-bridge-no-ble-clang-boringssl/chip-bridge-app", + runner, + ) + _add_target_to_cmd( + cmd, + "--lit-icd-app", + f"./out/{target_prefix}-lit-icd-no-ble-clang-boringssl/lit-icd-app", + runner, + ) + _add_target_to_cmd( + cmd, + "--microwave-oven-app", + f"./out/{target_prefix}-microwave-oven-no-ble-clang-boringssl/chip-microwave-oven-app", + runner, + ) + _add_target_to_cmd( + cmd, + "--rvc-app", + f"./out/{target_prefix}-rvc-no-ble-clang-boringssl/chip-rvc-app", + runner, + ) + + subprocess.run(_with_activate(cmd), check=True) + + +if __name__ == "__main__": + cli() diff --git a/scripts/tests/requirements.txt b/scripts/tests/requirements.txt index f942e0f542b63f..9e2d8570359155 100644 --- a/scripts/tests/requirements.txt +++ b/scripts/tests/requirements.txt @@ -1,6 +1,9 @@ # Python requirements for scripts in this location +alive_progress click colorama +coloredlogs diskcache +mypy==1.10.1 +tabulate websockets -mypy==1.10.1 \ No newline at end of file From 31894f61b9b5463706d910c43d4ff101a3e68dca Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Tue, 17 Sep 2024 15:34:03 -0400 Subject: [PATCH 03/47] Add DataModel::Provider Invoke usage (#35540) * Switch out invoke logic so that codegen data model provider can fully use it * Restyle * Update include paths * Update src/app/InteractionModelEngine.cpp Co-authored-by: Terence Hampson * Update documentation on invoke * More documentation * More documentation again * Update src/app/data-model-provider/Provider.h Co-authored-by: Boris Zbarsky * Update src/app/data-model-provider/Provider.h Co-authored-by: Boris Zbarsky * Comment cleanup * Update src/app/data-model-provider/Provider.h Co-authored-by: Terence Hampson --------- Co-authored-by: Terence Hampson Co-authored-by: Andrei Litvin Co-authored-by: Boris Zbarsky --- src/app/InteractionModelEngine.cpp | 20 +++++++++++ .../CodegenDataModelProvider.cpp | 33 ++++++++++++------- .../CodegenDataModelProvider.h | 4 +-- .../tests/TestCodegenModelViaMocks.cpp | 4 +-- src/app/data-model-provider/Provider.h | 22 +++++++------ src/app/tests/test-interaction-model-api.cpp | 6 ++-- src/app/tests/test-interaction-model-api.h | 4 +-- .../tests/data_model/DataModelFixtures.cpp | 6 ++-- .../tests/data_model/DataModelFixtures.h | 4 +-- 9 files changed, 67 insertions(+), 36 deletions(-) diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index 88c1777b6c8224..9b4282fb036d88 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -43,6 +43,10 @@ #include #if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE +#include + +// TODO: defaulting to codegen should eventually be an application choice and not +// hard-coded in the interaction model #include #endif @@ -1699,6 +1703,21 @@ CHIP_ERROR InteractionModelEngine::PushFront(SingleLinkedListNode *& aObjectL void InteractionModelEngine::DispatchCommand(CommandHandlerImpl & apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & apPayload) { +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + + DataModel::InvokeRequest request; + request.path = aCommandPath; + + std::optional status = GetDataModelProvider()->Invoke(request, apPayload, &apCommandObj); + + // Provider indicates that handler status or data was already set (or will be set asynchronously) by + // returning std::nullopt. If any other value is returned, it is requesting that a status is set. This + // includes CHIP_NO_ERROR: in this case CHIP_NO_ERROR would mean set a `status success on the command` + if (status.has_value()) + { + apCommandObj.AddStatus(aCommandPath, status->GetStatusCode()); + } +#else CommandHandlerInterface * handler = CommandHandlerInterfaceRegistry::Instance().GetCommandHandler(aCommandPath.mEndpointId, aCommandPath.mClusterId); @@ -1717,6 +1736,7 @@ void InteractionModelEngine::DispatchCommand(CommandHandlerImpl & apCommandObj, } DispatchSingleClusterCommand(aCommandPath, apPayload, &apCommandObj); +#endif // CHIP_CONFIG_USE_DATA_MODEL_INTERFACE } Protocols::InteractionModel::Status InteractionModelEngine::CommandExists(const ConcreteCommandPath & aCommandPath) diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp index 312f175778a314..4d42fc90282104 100644 --- a/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider.cpp @@ -17,6 +17,7 @@ #include #include +#include #include #include #include @@ -229,20 +230,28 @@ bool CodegenDataModelProvider::EmberCommandListIterator::Exists(const CommandId return (*mCurrentHint == toCheck); } -DataModel::ActionReturnStatus CodegenDataModelProvider::Invoke(const DataModel::InvokeRequest & request, - TLV::TLVReader & input_arguments, CommandHandler * handler) +std::optional CodegenDataModelProvider::Invoke(const DataModel::InvokeRequest & request, + TLV::TLVReader & input_arguments, + CommandHandler * handler) { - // TODO: CommandHandlerInterface support is currently - // residing in InteractionModelEngine itself. We may want to separate this out - // into its own registry, similar to attributes, so that IM is decoupled from actual storage of things. - // - // Open issue at https://github.com/project-chip/connectedhomeip/issues/34258 - - // Ember dispatching automatically uses `handler` to set an appropriate result or status - // This never fails (as handler error is encoded as needed). - DispatchSingleClusterCommand(request.path, input_arguments, handler); + CommandHandlerInterface * handler_interface = + CommandHandlerInterfaceRegistry::Instance().GetCommandHandler(request.path.mEndpointId, request.path.mClusterId); + + if (handler_interface) + { + CommandHandlerInterface::HandlerContext context(*handler, request.path, input_arguments); + handler_interface->InvokeCommand(context); - return CHIP_NO_ERROR; + // If the command was handled, don't proceed any further and return successfully. + if (context.mCommandHandled) + { + return std::nullopt; + } + } + + // Ember always sets the return in the handler + DispatchSingleClusterCommand(request.path, input_arguments, handler); + return std::nullopt; } EndpointId CodegenDataModelProvider::FirstEndpoint() diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider.h b/src/app/codegen-data-model-provider/CodegenDataModelProvider.h index b486b953976328..70d5e6f41abdd6 100644 --- a/src/app/codegen-data-model-provider/CodegenDataModelProvider.h +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider.h @@ -73,8 +73,8 @@ class CodegenDataModelProvider : public chip::app::DataModel::Provider AttributeValueEncoder & encoder) override; DataModel::ActionReturnStatus WriteAttribute(const DataModel::WriteAttributeRequest & request, AttributeValueDecoder & decoder) override; - DataModel::ActionReturnStatus Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, - CommandHandler * handler) override; + std::optional Invoke(const DataModel::InvokeRequest & request, + chip::TLV::TLVReader & input_arguments, CommandHandler * handler) override; /// attribute tree iteration EndpointId FirstEndpoint() override; diff --git a/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp b/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp index 649c6f02195a27..d5c0ea673fec80 100644 --- a/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp +++ b/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp @@ -2460,7 +2460,7 @@ TEST(TestCodegenModelViaMocks, EmberInvokeTest) const uint32_t kDispatchCountPre = chip::Test::DispatchCount(); // Using a handler set to nullptr as it is not used by the impl - ASSERT_EQ(model.Invoke(kInvokeRequest, tlvReader, /* handler = */ nullptr), CHIP_NO_ERROR); + ASSERT_EQ(model.Invoke(kInvokeRequest, tlvReader, /* handler = */ nullptr), std::nullopt); EXPECT_EQ(chip::Test::DispatchCount(), kDispatchCountPre + 1); // single dispatch EXPECT_EQ(chip::Test::GetLastDispatchPath(), kCommandPath); // for the right path @@ -2474,7 +2474,7 @@ TEST(TestCodegenModelViaMocks, EmberInvokeTest) const uint32_t kDispatchCountPre = chip::Test::DispatchCount(); // Using a handler set to nullpotr as it is not used by the impl - ASSERT_EQ(model.Invoke(kInvokeRequest, tlvReader, /* handler = */ nullptr), CHIP_NO_ERROR); + ASSERT_EQ(model.Invoke(kInvokeRequest, tlvReader, /* handler = */ nullptr), std::nullopt); EXPECT_EQ(chip::Test::DispatchCount(), kDispatchCountPre + 1); // single dispatch EXPECT_EQ(chip::Test::GetLastDispatchPath(), kCommandPath); // for the right path diff --git a/src/app/data-model-provider/Provider.h b/src/app/data-model-provider/Provider.h index f38568319eb425..6bd3f439e8a417 100644 --- a/src/app/data-model-provider/Provider.h +++ b/src/app/data-model-provider/Provider.h @@ -88,18 +88,20 @@ class Provider : public ProviderMetadataTree virtual ActionReturnStatus WriteAttribute(const WriteAttributeRequest & request, AttributeValueDecoder & decoder) = 0; /// `handler` is used to send back the reply. + /// - returning `std::nullopt` means that return value was placed in handler directly. + /// This includes cases where command handling and value return will be done asynchronously. /// - returning a value other than Success implies an error reply (error and data are mutually exclusive) /// - /// Returning anything other than CHIP_NO_ERROR or Status::Success (i.e. success without a return code) - /// means that the invoke will be considered to be returning the given path-specific status WITHOUT any data (any data - /// that was sent via CommandHandler is to be rolled back/discarded). - /// - /// This is because only one of the following may be encoded in a response: - /// - data (as CommandDataIB) which is assumed a "response as a success" - /// - status (as a CommandStatusIB) which is considered a final status, usually an error however - /// cluster-specific success statuses also exist. - virtual ActionReturnStatus Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, - CommandHandler * handler) = 0; + /// Return value expectations: + /// - if a response has been placed into `handler` then std::nullopt MUST be returned. In particular + /// note that CHIP_NO_ERROR is NOT the same as std::nullopt: + /// > CHIP_NO_ERROR means handler had no status set and we expect the caller to AddStatus(success) + /// > std::nullopt means that handler has added an appropriate data/status response + /// - if a value is returned (not nullopt) then the handler response MUST NOT be filled. The caller + /// will then issue `handler->AddStatus(request.path, ->GetStatusCode())`. This is a + /// convenience to make writing Invoke calls easier. + virtual std::optional Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CommandHandler * handler) = 0; private: InteractionModelContext mContext = { nullptr }; diff --git a/src/app/tests/test-interaction-model-api.cpp b/src/app/tests/test-interaction-model-api.cpp index f483f4b3de88a4..4ecc4d66706b0c 100644 --- a/src/app/tests/test-interaction-model-api.cpp +++ b/src/app/tests/test-interaction-model-api.cpp @@ -173,10 +173,10 @@ ActionReturnStatus TestImCustomDataModel::WriteAttribute(const WriteAttributeReq return CHIP_ERROR_NOT_IMPLEMENTED; } -ActionReturnStatus TestImCustomDataModel::Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, - CommandHandler * handler) +std::optional TestImCustomDataModel::Invoke(const InvokeRequest & request, + chip::TLV::TLVReader & input_arguments, CommandHandler * handler) { - return CHIP_ERROR_NOT_IMPLEMENTED; + return std::make_optional(CHIP_ERROR_NOT_IMPLEMENTED); } EndpointId TestImCustomDataModel::FirstEndpoint() diff --git a/src/app/tests/test-interaction-model-api.h b/src/app/tests/test-interaction-model-api.h index 6de6c9c34a2e21..7b1b1ad335b1e8 100644 --- a/src/app/tests/test-interaction-model-api.h +++ b/src/app/tests/test-interaction-model-api.h @@ -122,8 +122,8 @@ class TestImCustomDataModel : public DataModel::Provider AttributeValueEncoder & encoder) override; DataModel::ActionReturnStatus WriteAttribute(const DataModel::WriteAttributeRequest & request, AttributeValueDecoder & decoder) override; - DataModel::ActionReturnStatus Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, - CommandHandler * handler) override; + std::optional Invoke(const DataModel::InvokeRequest & request, + chip::TLV::TLVReader & input_arguments, CommandHandler * handler) override; EndpointId FirstEndpoint() override; EndpointId NextEndpoint(EndpointId before) override; diff --git a/src/controller/tests/data_model/DataModelFixtures.cpp b/src/controller/tests/data_model/DataModelFixtures.cpp index 05fa16b956bb0c..0333b24239e0e7 100644 --- a/src/controller/tests/data_model/DataModelFixtures.cpp +++ b/src/controller/tests/data_model/DataModelFixtures.cpp @@ -525,10 +525,10 @@ ActionReturnStatus CustomDataModel::WriteAttribute(const WriteAttributeRequest & return CHIP_ERROR_NOT_IMPLEMENTED; } -ActionReturnStatus CustomDataModel::Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, - CommandHandler * handler) +std::optional CustomDataModel::Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, + CommandHandler * handler) { - return CHIP_ERROR_NOT_IMPLEMENTED; + return std::make_optional(CHIP_ERROR_NOT_IMPLEMENTED); } EndpointId CustomDataModel::FirstEndpoint() diff --git a/src/controller/tests/data_model/DataModelFixtures.h b/src/controller/tests/data_model/DataModelFixtures.h index cfb2edf5db83f3..9c23b395bb7810 100644 --- a/src/controller/tests/data_model/DataModelFixtures.h +++ b/src/controller/tests/data_model/DataModelFixtures.h @@ -119,8 +119,8 @@ class CustomDataModel : public DataModel::Provider AttributeValueEncoder & encoder) override; DataModel::ActionReturnStatus WriteAttribute(const DataModel::WriteAttributeRequest & request, AttributeValueDecoder & decoder) override; - DataModel::ActionReturnStatus Invoke(const DataModel::InvokeRequest & request, chip::TLV::TLVReader & input_arguments, - CommandHandler * handler) override; + std::optional Invoke(const DataModel::InvokeRequest & request, + chip::TLV::TLVReader & input_arguments, CommandHandler * handler) override; EndpointId FirstEndpoint() override; EndpointId NextEndpoint(EndpointId before) override; From ead3862809da9f40bc7cfe3964827d899e8ce2e1 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 17 Sep 2024 16:14:46 -0400 Subject: [PATCH 04/47] Fix data version handling in test033_TestMTRDeviceDeviceConfigurationChanged (#35628) Data versions are per-cluster, not per-attribute, so every time we inject an attribute report for a given cluster we need to bump the data version. Also: * Fixes checkAttributeReportTriggersConfigurationChanged to be an instance method, since it was taking the instance as an argument anyway. * Fixes checkAttributeReportTriggersConfigurationChanged to provide descriptions for its expectations and assertions that identify the callsite. * Adds some logging to MTRDevice to make it a little easier to tell which parts of attribute reporting are or are not happening and in which order. --- .../Framework/CHIP/MTRDevice_Concrete.mm | 12 +- .../Framework/CHIPTests/MTRDeviceTests.m | 242 ++++++++---------- 2 files changed, 122 insertions(+), 132 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm index bc0eaa92aa5099..d741d0124945fb 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_Concrete.mm @@ -1737,6 +1737,8 @@ - (void)setStorageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration * - (void)_handleReportEnd { + MTR_LOG("%@ handling report end", self); + std::lock_guard lock(_lock); _receivingReport = NO; _receivingPrimingReport = NO; @@ -1853,6 +1855,11 @@ - (void)_reportAttributes:(NSArray *> *)attributes - (void)_handleAttributeReport:(NSArray *> *)attributeReport fromSubscription:(BOOL)isFromSubscription { + // Note: %p to avoid double-logging the whole big structure; can be matched + // up to where we receive the attribute report, which logs pointer value and + // actual value. + MTR_LOG("%@ handling attribute report %p, fromSubscription: %@", self, attributeReport, MTR_YES_NO(isFromSubscription)); + std::lock_guard lock(_lock); // _getAttributesToReportWithReportedValues will log attribute paths reported @@ -1863,6 +1870,7 @@ - (void)_handleAttributeReport:(NSArray *> *)attrib - (void)_injectAttributeReport:(NSArray *> *)attributeReport fromSubscription:(BOOL)isFromSubscription { [_deviceController asyncDispatchToMatterQueue:^{ + MTR_LOG("%@ injected attribute report (%p) %@", self, attributeReport, attributeReport); [self _handleReportBegin]; dispatch_async(self.queue, ^{ [self _handleAttributeReport:attributeReport fromSubscription:isFromSubscription]; @@ -2396,7 +2404,7 @@ - (void)_setupSubscriptionWithReason:(NSString *)reason auto callback = std::make_unique( ^(NSArray * value) { - MTR_LOG("%@ got attribute report %@", self, value); + MTR_LOG("%@ got attribute report (%p) %@", self, value, value); dispatch_async(self.queue, ^{ // OnAttributeData [self _handleAttributeReport:value fromSubscription:YES]; @@ -2823,7 +2831,7 @@ static BOOL AttributeHasChangesOmittedQuality(MTRAttributePath * attributePath) if (values) { // Since the format is the same data-value dictionary, this looks like an // attribute report - MTR_LOG("Read attribute work item [%llu] result: %@ [0x%016llX:%@:0x%llX:0x%llX]", workItemID, values, nodeID.unsignedLongLongValue, endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue); + MTR_LOG("Read attribute work item [%llu] result: (%p) %@ [0x%016llX:%@:0x%llX:0x%llX]", workItemID, values, values, nodeID.unsignedLongLongValue, endpointID, clusterID.unsignedLongLongValue, attributeID.unsignedLongLongValue); [self _handleAttributeReport:values fromSubscription:NO]; } diff --git a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m index 459eec5919ceab..a84b9794ef824a 100644 --- a/src/darwin/Framework/CHIPTests/MTRDeviceTests.m +++ b/src/darwin/Framework/CHIPTests/MTRDeviceTests.m @@ -128,16 +128,6 @@ - (void)controller:(MTRDeviceController *)controller commissioningComplete:(NSEr @interface MTRDeviceTests : XCTestCase -+ (void)checkAttributeReportTriggersConfigurationChanged:(MTRAttributeIDType)attributeId - clusterId:(MTRClusterIDType)clusterId - endpointId:(NSNumber *)endpointId - device:(MTRDevice *)device - delegate:(MTRDeviceTestDelegate *)delegate - dataVersion:(NSNumber *)dataVersion - attributeReport:(NSArray *> *)attributeReport - testcase:(XCTestCase *)testcase - expectConfigurationChanged:(BOOL)expectConfigurationChanged; - @end @implementation MTRDeviceTests @@ -3213,26 +3203,25 @@ - (void)test032_MTRPathClassesEncoding // Helper API to test if changes in an attribute with a path specified by endpointId, clusterId and attributeId trigger // device configuration changed callbacks for a given MTRDevice. This API creates a fake attribute report for the given attribute path // and injects it into MTRDevice to exercise and test the delegate's device configuration changed callback. -+ (void)checkAttributeReportTriggersConfigurationChanged:(MTRAttributeIDType)attributeId +- (void)checkAttributeReportTriggersConfigurationChanged:(MTRAttributeIDType)attributeId clusterId:(MTRClusterIDType)clusterId endpointId:(NSNumber *)endpointId device:(MTRDevice *)device delegate:(MTRDeviceTestDelegate *)delegate dataVersion:(NSNumber *)dataVersion attributeReport:(NSArray *> *)attributeReport - testcase:(XCTestCase *)testcase + description:(NSString *)description expectConfigurationChanged:(BOOL)expectConfigurationChanged { - XCTAssertNotNil(endpointId); - XCTAssertNotNil(device); - XCTAssertNotNil(delegate); - XCTAssertNotNil(dataVersion); - XCTAssertNotNil(attributeReport); - XCTAssertNotNil(testcase); - - XCTestExpectation * gotAttributeReportExpectation = [testcase expectationWithDescription:@"Attribute report has been received"]; - XCTestExpectation * gotAttributeReportEndExpectation = [testcase expectationWithDescription:@"Attribute report has ended"]; - XCTestExpectation * deviceConfigurationChangedExpectation = [testcase expectationWithDescription:@"Device configuration changed was received"]; + XCTAssertNotNil(endpointId, @"%@", description); + XCTAssertNotNil(device, @"%@", description); + XCTAssertNotNil(delegate, @"%@", description); + XCTAssertNotNil(dataVersion, @"%@", description); + XCTAssertNotNil(attributeReport, @"%@", description); + + XCTestExpectation * gotAttributeReportExpectation = [self expectationWithDescription:[NSString stringWithFormat:@"Attribute report has been received (%@)", description]]; + XCTestExpectation * gotAttributeReportEndExpectation = [self expectationWithDescription:[NSString stringWithFormat:@"Attribute report has ended (%@)", description]]; + XCTestExpectation * deviceConfigurationChangedExpectation = [self expectationWithDescription:[NSString stringWithFormat:@"Device configuration changed was received (%@)", description]]; deviceConfigurationChangedExpectation.inverted = !expectConfigurationChanged; __block unsigned attributeReportsReceived = 0; @@ -3242,7 +3231,7 @@ + (void)checkAttributeReportTriggersConfigurationChanged:(MTRAttributeIDType)att MTRAttributePath * attributePath = attributeDict[MTRAttributePathKey]; if (attributePath.attribute.unsignedLongLongValue == attributeId) { NSDictionary * data = attributeDict[MTRDataKey]; - XCTAssertNotNil(data); + XCTAssertNotNil(data, @"%@", description); testDataValue = data[MTRValueKey]; } } @@ -3250,26 +3239,26 @@ + (void)checkAttributeReportTriggersConfigurationChanged:(MTRAttributeIDType)att // Check if the received attribute report matches the injected attribute report. delegate.onAttributeDataReceived = ^(NSArray *> * attributeReport) { attributeReportsReceived += attributeReport.count; - XCTAssert(attributeReportsReceived > 0); + XCTAssert(attributeReportsReceived > 0, @"%@", description); for (NSDictionary * attributeDict in attributeReport) { MTRAttributePath * attributePath = attributeDict[MTRAttributePathKey]; - XCTAssertNotNil(attributePath); + XCTAssertNotNil(attributePath, @"%@", description); - XCTAssertEqualObjects(attributePath.cluster, @(clusterId)); - XCTAssertEqualObjects(attributePath.attribute, @(attributeId)); + XCTAssertEqualObjects(attributePath.cluster, @(clusterId), @"%@", description); + XCTAssertEqualObjects(attributePath.attribute, @(attributeId), @"%@", description); NSDictionary * data = attributeDict[MTRDataKey]; - XCTAssertNotNil(data); - XCTAssertEqualObjects(data[MTRDataVersionKey], dataVersion); + XCTAssertNotNil(data, @"%@", description); + XCTAssertEqualObjects(data[MTRDataVersionKey], dataVersion, @"%@", description); // This code assumes that none of the attributes in the report can have null values. // Since we are injecting the attribute report for testing this with non-null values, // we are fine for now. But if we plan to inject attribute reports with attributes having // null values, we need to fix the code accordingly. id dataValue = data[MTRValueKey]; - XCTAssertNotNil(dataValue); - XCTAssertNotNil(testDataValue); - XCTAssertEqualObjects(dataValue, testDataValue); + XCTAssertNotNil(dataValue, @"%@", description); + XCTAssertNotNil(testDataValue, @"%@", description); + XCTAssertEqualObjects(dataValue, testDataValue, @"%@", description); [gotAttributeReportExpectation fulfill]; } }; @@ -3287,9 +3276,9 @@ + (void)checkAttributeReportTriggersConfigurationChanged:(MTRAttributeIDType)att [device unitTestInjectAttributeReport:attributeReport fromSubscription:YES]; - [testcase waitForExpectations:@[ gotAttributeReportExpectation, gotAttributeReportEndExpectation, deviceConfigurationChangedExpectation ] timeout:kTimeoutInSeconds]; + [self waitForExpectations:@[ gotAttributeReportExpectation, gotAttributeReportEndExpectation, deviceConfigurationChangedExpectation ] timeout:kTimeoutInSeconds]; if (!expectConfigurationChanged) { - XCTAssertFalse(wasOnDeviceConfigurationChangedCallbackCalled); + XCTAssertFalse(wasOnDeviceConfigurationChangedCallbackCalled, @"%@", description); } } @@ -3309,26 +3298,26 @@ - (void)test033_TestMTRDeviceDeviceConfigurationChanged __block unsigned attributeReportsReceived = 0; - // Get the data version for the following attributes that we will use for the tests - parts list, device types list and server list for descriptor cluster, - // attribute list and cluster revision for the Identify cluster, accepted commands list for oven cavity operational state ID cluster and - // feature map for groups ID cluster. - __block NSNumber * dataVersionForPartsList; + // Get the data version for the following clusters that we will use for the tests - Descriptor cluster on endpoint 0, + // Identify cluster, On/Off cluster, Oven Cavity Operational State cluster and Groups cluster. + __block NSNumber * dataVersionForDescriptor; __block NSMutableArray *> * valueForPartsList; - __block NSNumber * endpointForPartsList; - __block NSNumber * dataVersionForDeviceTypesList; - __block NSNumber * endpointForDeviceTypeList; - __block NSNumber * dataVersionForServerList; - __block NSNumber * endpointForServerList; - __block NSNumber * dataVersionForAcceptedCommandList; - __block NSNumber * endpointForAcceptedCommandList; - __block NSNumber * dataVersionForAttributeList; - __block NSNumber * endpointForAttributeList; - __block NSNumber * dataVersionForClusterRevision; - __block NSNumber * endpointForClusterRevision; - __block NSNumber * dataVersionForFeatureMap; - __block NSNumber * endpointForFeatureMap; - __block NSNumber * dataVersionForPowerConfigurationSources; - __block NSNumber * endpointForPowerConfigurationSources; + const uint32_t kDescriptorEndpoint = 0; + + __block NSNumber * dataVersionForOvenCavityOperationalState; + __block NSNumber * endpointForOvenCavityOperationalStateAcceptedCommandList; + + __block NSNumber * dataVersionForIdentify; + __block NSNumber * endpointForIdentifyAttributeList; + + __block NSNumber * dataVersionForOnOff; + __block NSNumber * endpointForOnOffClusterRevision; + + __block NSNumber * dataVersionForGroups; + __block NSNumber * endpointForGroupsFeatureMap; + + __block NSNumber * dataVersionForPowerSourceConfiguration; + __block NSNumber * endpointForPowerSourceConfigurationSources; delegate.onAttributeDataReceived = ^(NSArray *> * attributeReport) { attributeReportsReceived += attributeReport.count; @@ -3338,24 +3327,14 @@ - (void)test033_TestMTRDeviceDeviceConfigurationChanged MTRAttributePath * attributePath = attributeDict[MTRAttributePathKey]; XCTAssertNotNil(attributePath); - if (attributePath.cluster.unsignedLongValue == MTRClusterIDTypeDescriptorID && attributePath.endpoint.unsignedLongValue == 0) { + if (attributePath.cluster.unsignedLongValue == MTRClusterIDTypeDescriptorID && attributePath.endpoint.unsignedLongValue == kDescriptorEndpoint) { NSDictionary * data = attributeDict[MTRDataKey]; XCTAssertNotNil(data); + dataVersionForDescriptor = data[MTRDataVersionKey]; + switch (attributePath.attribute.unsignedLongValue) { case MTRAttributeIDTypeClusterDescriptorAttributePartsListID: { - dataVersionForPartsList = data[MTRDataVersionKey]; valueForPartsList = [data[MTRValueKey] mutableCopy]; - endpointForPartsList = attributePath.endpoint; - break; - } - case MTRAttributeIDTypeClusterDescriptorAttributeDeviceTypeListID: { - dataVersionForDeviceTypesList = data[MTRDataVersionKey]; - endpointForDeviceTypeList = attributePath.endpoint; - break; - } - case MTRAttributeIDTypeClusterDescriptorAttributeServerListID: { - dataVersionForServerList = data[MTRDataVersionKey]; - endpointForServerList = attributePath.endpoint; break; } } @@ -3364,44 +3343,47 @@ - (void)test033_TestMTRDeviceDeviceConfigurationChanged XCTAssertNotNil(data); switch (attributePath.attribute.unsignedLongValue) { case MTRAttributeIDTypeGlobalAttributeAttributeListID: { - dataVersionForAttributeList = data[MTRDataVersionKey]; - endpointForAttributeList = attributePath.endpoint; + dataVersionForIdentify = data[MTRDataVersionKey]; + endpointForIdentifyAttributeList = attributePath.endpoint; break; } + } + } else if (attributePath.cluster.unsignedLongValue == MTRClusterIDTypeOnOffID) { + NSDictionary * data = attributeDict[MTRDataKey]; + XCTAssertNotNil(data); + switch (attributePath.attribute.unsignedLongValue) { case MTRAttributeIDTypeGlobalAttributeClusterRevisionID: { - dataVersionForClusterRevision = data[MTRDataVersionKey]; - endpointForClusterRevision = attributePath.endpoint; + dataVersionForOnOff = data[MTRDataVersionKey]; + endpointForOnOffClusterRevision = attributePath.endpoint; break; } } } else if (attributePath.cluster.unsignedLongValue == MTRClusterIDTypeOvenCavityOperationalStateID && attributePath.attribute.unsignedLongValue == MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID) { NSDictionary * data = attributeDict[MTRDataKey]; XCTAssertNotNil(data); - dataVersionForAcceptedCommandList = data[MTRDataVersionKey]; - endpointForAcceptedCommandList = attributePath.endpoint; + dataVersionForOvenCavityOperationalState = data[MTRDataVersionKey]; + endpointForOvenCavityOperationalStateAcceptedCommandList = attributePath.endpoint; } else if (attributePath.cluster.unsignedLongValue == MTRClusterIDTypeGroupsID && attributePath.attribute.unsignedLongValue == MTRAttributeIDTypeGlobalAttributeFeatureMapID) { NSDictionary * data = attributeDict[MTRDataKey]; XCTAssertNotNil(data); - dataVersionForFeatureMap = data[MTRDataVersionKey]; - endpointForFeatureMap = attributePath.endpoint; + dataVersionForGroups = data[MTRDataVersionKey]; + endpointForGroupsFeatureMap = attributePath.endpoint; } else if (attributePath.cluster.unsignedLongValue == MTRClusterIDTypePowerSourceConfigurationID && attributePath.attribute.unsignedLongValue == MTRAttributeIDTypeClusterPowerSourceConfigurationAttributeSourcesID) { NSDictionary * data = attributeDict[MTRDataKey]; XCTAssertNotNil(data); - dataVersionForPowerConfigurationSources = data[MTRDataVersionKey]; - endpointForPowerConfigurationSources = attributePath.endpoint; + dataVersionForPowerSourceConfiguration = data[MTRDataVersionKey]; + endpointForPowerSourceConfigurationSources = attributePath.endpoint; } } }; delegate.onReportEnd = ^() { - XCTAssertNotNil(dataVersionForPartsList); - XCTAssertNotNil(dataVersionForDeviceTypesList); - XCTAssertNotNil(dataVersionForServerList); - XCTAssertNotNil(dataVersionForAttributeList); - XCTAssertNotNil(dataVersionForClusterRevision); - XCTAssertNotNil(dataVersionForAcceptedCommandList); - XCTAssertNotNil(dataVersionForFeatureMap); - XCTAssertNotNil(dataVersionForPowerConfigurationSources); + XCTAssertNotNil(dataVersionForDescriptor); + XCTAssertNotNil(dataVersionForOvenCavityOperationalState); + XCTAssertNotNil(dataVersionForIdentify); + XCTAssertNotNil(dataVersionForOnOff); + XCTAssertNotNil(dataVersionForGroups); + XCTAssertNotNil(dataVersionForPowerSourceConfiguration); [gotInitialReportsExpectation fulfill]; }; @@ -3420,7 +3402,7 @@ - (void)test033_TestMTRDeviceDeviceConfigurationChanged // 3. Call the helper checkAttributeReportTriggersConfigurationChanged to test if the attribute report affects device configuration changes. // Test attribute path - endpointId = 0, clusterId = descriptor, attributeId = parts list. - dataVersionForPartsList = [NSNumber numberWithUnsignedLongLong:(dataVersionForPartsList.unsignedLongLongValue + 1)]; + dataVersionForDescriptor = @(dataVersionForDescriptor.unsignedLongLongValue + 1); // Figure out an endpoint ID (not 0) we can add to PartsList. for (unsigned i = 1; true; ++i) { __auto_type unsignedIntegerValue = @{ @@ -3436,18 +3418,18 @@ - (void)test033_TestMTRDeviceDeviceConfigurationChanged } } NSArray *> * attributeReport = @[ @{ - MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForPartsList clusterID:@(MTRClusterIDTypeDescriptorID) attributeID:@(MTRAttributeIDTypeClusterDescriptorAttributePartsListID)], + MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:@(kDescriptorEndpoint) clusterID:@(MTRClusterIDTypeDescriptorID) attributeID:@(MTRAttributeIDTypeClusterDescriptorAttributePartsListID)], MTRDataKey : @ { - MTRDataVersionKey : dataVersionForPartsList, + MTRDataVersionKey : dataVersionForDescriptor, MTRTypeKey : MTRArrayValueType, MTRValueKey : valueForPartsList, } } ]; - [MTRDeviceTests checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeClusterDescriptorAttributePartsListID clusterId:MTRClusterIDTypeDescriptorID endpointId:endpointForPartsList device:device delegate:delegate dataVersion:dataVersionForPartsList attributeReport:attributeReport testcase:self expectConfigurationChanged:YES]; + [self checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeClusterDescriptorAttributePartsListID clusterId:MTRClusterIDTypeDescriptorID endpointId:@(kDescriptorEndpoint) device:device delegate:delegate dataVersion:dataVersionForDescriptor attributeReport:attributeReport description:@"Descriptor PartsList" expectConfigurationChanged:YES]; // Test attribute path - endpointId = 0, clusterId = descriptor, attributeId = device types list. - dataVersionForDeviceTypesList = [NSNumber numberWithUnsignedLongLong:(dataVersionForDeviceTypesList.unsignedLongLongValue + 1)]; + dataVersionForDescriptor = @(dataVersionForDescriptor.unsignedLongLongValue + 1); NSArray *> * deviceTypesListValue = @[ @{ MTRDataKey : @ { @@ -3473,9 +3455,9 @@ - (void)test033_TestMTRDeviceDeviceConfigurationChanged ]; attributeReport = @[ @{ - MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForDeviceTypeList clusterID:@(MTRClusterIDTypeDescriptorID) attributeID:@(MTRAttributeIDTypeClusterDescriptorAttributeDeviceTypeListID)], + MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:@(kDescriptorEndpoint) clusterID:@(MTRClusterIDTypeDescriptorID) attributeID:@(MTRAttributeIDTypeClusterDescriptorAttributeDeviceTypeListID)], MTRDataKey : @ { - MTRDataVersionKey : dataVersionForDeviceTypesList, + MTRDataVersionKey : dataVersionForDescriptor, MTRTypeKey : MTRArrayValueType, MTRValueKey : deviceTypesListValue, } @@ -3503,85 +3485,85 @@ - (void)test033_TestMTRDeviceDeviceConfigurationChanged }, ]; - [MTRDeviceTests checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeClusterDescriptorAttributeDeviceTypeListID clusterId:MTRClusterIDTypeDescriptorID endpointId:endpointForDeviceTypeList device:device delegate:delegate dataVersion:dataVersionForDeviceTypesList attributeReport:attributeReport testcase:self expectConfigurationChanged:YES]; + [self checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeClusterDescriptorAttributeDeviceTypeListID clusterId:MTRClusterIDTypeDescriptorID endpointId:@(kDescriptorEndpoint) device:device delegate:delegate dataVersion:dataVersionForDescriptor attributeReport:attributeReport description:@"Descriptor DeviceTypeList" expectConfigurationChanged:YES]; // Test attribute path - endpointId = 0, clusterId = descriptor, attributeId = server list. - dataVersionForServerList = [NSNumber numberWithUnsignedLongLong:(dataVersionForServerList.unsignedLongLongValue + 1)]; + dataVersionForDescriptor = @(dataVersionForDescriptor.unsignedLongLongValue + 1); attributeReport = @[ @{ - MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForServerList clusterID:@(MTRClusterIDTypeDescriptorID) attributeID:@(MTRAttributeIDTypeClusterDescriptorAttributeServerListID)], + MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:@(kDescriptorEndpoint) clusterID:@(MTRClusterIDTypeDescriptorID) attributeID:@(MTRAttributeIDTypeClusterDescriptorAttributeServerListID)], MTRDataKey : @ { - MTRDataVersionKey : dataVersionForServerList, + MTRDataVersionKey : dataVersionForDescriptor, MTRTypeKey : MTRArrayValueType, MTRValueKey : unsignedIntegerArrayValue, } } ]; - [MTRDeviceTests checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeClusterDescriptorAttributeServerListID clusterId:MTRClusterIDTypeDescriptorID endpointId:endpointForServerList device:device delegate:delegate dataVersion:dataVersionForServerList attributeReport:attributeReport testcase:self expectConfigurationChanged:YES]; + [self checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeClusterDescriptorAttributeServerListID clusterId:MTRClusterIDTypeDescriptorID endpointId:@(kDescriptorEndpoint) device:device delegate:delegate dataVersion:dataVersionForDescriptor attributeReport:attributeReport description:@"Descriptor ServerList" expectConfigurationChanged:YES]; - // Test attribute path - endpointId = 1, clusterId = ovencavityoperationalstateID, attributeId = accepted command list. - dataVersionForAcceptedCommandList = [NSNumber numberWithUnsignedLongLong:(dataVersionForAcceptedCommandList.unsignedLongLongValue + 1)]; + // Test attribute path - clusterId = ovencavityoperationalstateID, attributeId = accepted command list. + dataVersionForOvenCavityOperationalState = @(dataVersionForOvenCavityOperationalState.unsignedLongLongValue + 1); attributeReport = @[ @{ - MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForAcceptedCommandList clusterID:@(MTRClusterIDTypeOvenCavityOperationalStateID) attributeID:@(MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID)], + MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForOvenCavityOperationalStateAcceptedCommandList clusterID:@(MTRClusterIDTypeOvenCavityOperationalStateID) attributeID:@(MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID)], MTRDataKey : @ { - MTRDataVersionKey : dataVersionForAcceptedCommandList, + MTRDataVersionKey : dataVersionForOvenCavityOperationalState, MTRTypeKey : MTRArrayValueType, MTRValueKey : unsignedIntegerArrayValue, } } ]; - [MTRDeviceTests checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID clusterId:MTRClusterIDTypeOvenCavityOperationalStateID endpointId:endpointForAcceptedCommandList device:device delegate:delegate dataVersion:dataVersionForAcceptedCommandList attributeReport:attributeReport testcase:self expectConfigurationChanged:YES]; + [self checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeGlobalAttributeAcceptedCommandListID clusterId:MTRClusterIDTypeOvenCavityOperationalStateID endpointId:endpointForOvenCavityOperationalStateAcceptedCommandList device:device delegate:delegate dataVersion:dataVersionForOvenCavityOperationalState attributeReport:attributeReport description:@"OvenCavityOperationalState AcceptedCommandList" expectConfigurationChanged:YES]; - // Test attribute path - endpointId = 0, clusterId = identify, attributeId = attribute list. - dataVersionForAttributeList = [NSNumber numberWithUnsignedLongLong:(dataVersionForAttributeList.unsignedLongLongValue + 1)]; + // Test attribute path - clusterId = identify, attributeId = attribute list. + dataVersionForIdentify = @(dataVersionForIdentify.unsignedLongLongValue + 1); attributeReport = @[ @{ - MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForAttributeList clusterID:@(MTRClusterIDTypeIdentifyID) attributeID:@(MTRAttributeIDTypeGlobalAttributeAttributeListID)], + MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForIdentifyAttributeList clusterID:@(MTRClusterIDTypeIdentifyID) attributeID:@(MTRAttributeIDTypeGlobalAttributeAttributeListID)], MTRDataKey : @ { - MTRDataVersionKey : dataVersionForAttributeList, + MTRDataVersionKey : dataVersionForIdentify, MTRTypeKey : MTRArrayValueType, MTRValueKey : unsignedIntegerArrayValue, } } ]; - [MTRDeviceTests checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeGlobalAttributeAttributeListID clusterId:MTRClusterIDTypeIdentifyID endpointId:endpointForAttributeList device:device delegate:delegate dataVersion:dataVersionForAttributeList attributeReport:attributeReport testcase:self expectConfigurationChanged:YES]; + [self checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeGlobalAttributeAttributeListID clusterId:MTRClusterIDTypeIdentifyID endpointId:endpointForIdentifyAttributeList device:device delegate:delegate dataVersion:dataVersionForIdentify attributeReport:attributeReport description:@"Identify AttributeList" expectConfigurationChanged:YES]; - // Test attribute path - endpointId = 0, clusterId = identify, attributeId = cluster revision. - dataVersionForClusterRevision = [NSNumber numberWithUnsignedLongLong:(dataVersionForClusterRevision.unsignedLongLongValue + 1)]; + // Test attribute path - clusterId = OnOff, attributeId = cluster revision. + dataVersionForOnOff = @(dataVersionForOnOff.unsignedLongLongValue + 1); attributeReport = @[ @{ - MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForClusterRevision clusterID:@(MTRClusterIDTypeIdentifyID) attributeID:@(MTRAttributeIDTypeGlobalAttributeClusterRevisionID)], + MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForOnOffClusterRevision clusterID:@(MTRClusterIDTypeIdentifyID) attributeID:@(MTRAttributeIDTypeGlobalAttributeClusterRevisionID)], MTRDataKey : @ { - MTRDataVersionKey : dataVersionForClusterRevision, + MTRDataVersionKey : dataVersionForOnOff, MTRTypeKey : MTRUnsignedIntegerValueType, MTRValueKey : @9999, } } ]; - [MTRDeviceTests checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeGlobalAttributeClusterRevisionID clusterId:MTRClusterIDTypeIdentifyID endpointId:endpointForClusterRevision device:device delegate:delegate dataVersion:dataVersionForClusterRevision attributeReport:attributeReport testcase:self expectConfigurationChanged:YES]; + [self checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeGlobalAttributeClusterRevisionID clusterId:MTRClusterIDTypeIdentifyID endpointId:endpointForOnOffClusterRevision device:device delegate:delegate dataVersion:dataVersionForOnOff attributeReport:attributeReport description:@"OnOff ClusterRevision" expectConfigurationChanged:YES]; - // Test attribute path - endpointId = 0, clusterId = groupsID, attributeId = feature map. - dataVersionForFeatureMap = [NSNumber numberWithUnsignedLongLong:(dataVersionForFeatureMap.unsignedLongLongValue + 1)]; + // Test attribute path - clusterId = groupsID, attributeId = feature map. + dataVersionForGroups = @(dataVersionForGroups.unsignedLongLongValue + 1); attributeReport = @[ @{ - MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForFeatureMap clusterID:@(MTRClusterIDTypeGroupsID) attributeID:@(MTRAttributeIDTypeGlobalAttributeFeatureMapID)], + MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForGroupsFeatureMap clusterID:@(MTRClusterIDTypeGroupsID) attributeID:@(MTRAttributeIDTypeGlobalAttributeFeatureMapID)], MTRDataKey : @ { - MTRDataVersionKey : dataVersionForFeatureMap, + MTRDataVersionKey : dataVersionForGroups, MTRTypeKey : MTRUnsignedIntegerValueType, MTRValueKey : @2, } } ]; - [MTRDeviceTests checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeGlobalAttributeFeatureMapID clusterId:MTRClusterIDTypeGroupsID endpointId:endpointForFeatureMap device:device delegate:delegate dataVersion:dataVersionForFeatureMap attributeReport:attributeReport testcase:self expectConfigurationChanged:YES]; + [self checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeGlobalAttributeFeatureMapID clusterId:MTRClusterIDTypeGroupsID endpointId:endpointForGroupsFeatureMap device:device delegate:delegate dataVersion:dataVersionForGroups attributeReport:attributeReport description:@"Groups FeatureMap" expectConfigurationChanged:YES]; - // Test attribute path that doesn't cause a device configuration changed - endpointId = 1, clusterId = power source configuration, attributeId = sources. - dataVersionForPowerConfigurationSources = [NSNumber numberWithUnsignedLongLong:(dataVersionForPowerConfigurationSources.unsignedLongLongValue + 1)]; + // Test attribute path that doesn't cause a device configuration clusterId = power source configuration, attributeId = sources. + dataVersionForPowerSourceConfiguration = @(dataVersionForPowerSourceConfiguration.unsignedLongLongValue + 1); attributeReport = @[ @{ - MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForPowerConfigurationSources clusterID:@(MTRClusterIDTypePowerSourceConfigurationID) attributeID:@(MTRAttributeIDTypeClusterPowerSourceConfigurationAttributeSourcesID)], + MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForPowerSourceConfigurationSources clusterID:@(MTRClusterIDTypePowerSourceConfigurationID) attributeID:@(MTRAttributeIDTypeClusterPowerSourceConfigurationAttributeSourcesID)], MTRDataKey : @ { - MTRDataVersionKey : dataVersionForPowerConfigurationSources, + MTRDataVersionKey : dataVersionForPowerSourceConfiguration, MTRTypeKey : MTRArrayValueType, MTRValueKey : unsignedIntegerArrayValue, } } ]; - [MTRDeviceTests checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeClusterPowerSourceConfigurationAttributeSourcesID clusterId:MTRClusterIDTypePowerSourceConfigurationID endpointId:endpointForPowerConfigurationSources device:device delegate:delegate dataVersion:dataVersionForPowerConfigurationSources attributeReport:attributeReport testcase:self expectConfigurationChanged:NO]; + [self checkAttributeReportTriggersConfigurationChanged:MTRAttributeIDTypeClusterPowerSourceConfigurationAttributeSourcesID clusterId:MTRClusterIDTypePowerSourceConfigurationID endpointId:endpointForPowerSourceConfigurationSources device:device delegate:delegate dataVersion:dataVersionForPowerSourceConfiguration attributeReport:attributeReport description:@"PowerSourceConfiguration Sources" expectConfigurationChanged:NO]; NSArray *> * newUnsignedIntegerArrayValue = @[ @{ @@ -3599,30 +3581,30 @@ - (void)test033_TestMTRDeviceDeviceConfigurationChanged ]; // Test an attribute report with multiple attributes at least one of which triggers device configuration changed. - dataVersionForAttributeList = [NSNumber numberWithUnsignedLongLong:(dataVersionForAttributeList.unsignedLongLongValue + 1)]; - dataVersionForFeatureMap = [NSNumber numberWithUnsignedLongLong:(dataVersionForFeatureMap.unsignedLongLongValue + 1)]; - dataVersionForPowerConfigurationSources = [NSNumber numberWithUnsignedLongLong:(dataVersionForPowerConfigurationSources.unsignedLongLongValue + 1)]; + dataVersionForIdentify = @(dataVersionForIdentify.unsignedLongLongValue + 1); + dataVersionForGroups = @(dataVersionForGroups.unsignedLongLongValue + 1); + dataVersionForPowerSourceConfiguration = @(dataVersionForPowerSourceConfiguration.unsignedLongLongValue + 1); attributeReport = @[ @{ - MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForAttributeList clusterID:@(MTRClusterIDTypeIdentifyID) attributeID:@(MTRAttributeIDTypeGlobalAttributeAttributeListID)], + MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForIdentifyAttributeList clusterID:@(MTRClusterIDTypeIdentifyID) attributeID:@(MTRAttributeIDTypeGlobalAttributeAttributeListID)], MTRDataKey : @ { - MTRDataVersionKey : dataVersionForAttributeList, + MTRDataVersionKey : dataVersionForIdentify, MTRTypeKey : MTRArrayValueType, MTRValueKey : unsignedIntegerArrayValue, } }, @{ - MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForFeatureMap clusterID:@(MTRClusterIDTypeGroupsID) attributeID:@(MTRAttributeIDTypeGlobalAttributeFeatureMapID)], + MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForGroupsFeatureMap clusterID:@(MTRClusterIDTypeGroupsID) attributeID:@(MTRAttributeIDTypeGlobalAttributeFeatureMapID)], MTRDataKey : @ { - MTRDataVersionKey : dataVersionForFeatureMap, + MTRDataVersionKey : dataVersionForGroups, MTRTypeKey : MTRUnsignedIntegerValueType, MTRValueKey : @3, } }, @{ - MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForPowerConfigurationSources clusterID:@(MTRClusterIDTypePowerSourceConfigurationID) attributeID:@(MTRAttributeIDTypeClusterPowerSourceConfigurationAttributeSourcesID)], + MTRAttributePathKey : [MTRAttributePath attributePathWithEndpointID:endpointForPowerSourceConfigurationSources clusterID:@(MTRClusterIDTypePowerSourceConfigurationID) attributeID:@(MTRAttributeIDTypeClusterPowerSourceConfigurationAttributeSourcesID)], MTRDataKey : @ { - MTRDataVersionKey : dataVersionForPowerConfigurationSources, + MTRDataVersionKey : dataVersionForPowerSourceConfiguration, MTRTypeKey : MTRArrayValueType, MTRValueKey : newUnsignedIntegerArrayValue, } From 210649272d8eb6528c0e27d19b52ea1c9123dbd2 Mon Sep 17 00:00:00 2001 From: Terence Hampson Date: Tue, 17 Sep 2024 16:58:31 -0400 Subject: [PATCH 05/47] [FabricSync] Changed SDK TODO comment to spec TODO comment (#35622) --- examples/fabric-admin/rpc/RpcServer.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/examples/fabric-admin/rpc/RpcServer.cpp b/examples/fabric-admin/rpc/RpcServer.cpp index 94bca111d9c421..3fb181eac5f21b 100644 --- a/examples/fabric-admin/rpc/RpcServer.cpp +++ b/examples/fabric-admin/rpc/RpcServer.cpp @@ -47,7 +47,7 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate public: void OnCheckInCompleted(const chip::app::ICDClientInfo & clientInfo) override { - // Needs for accessing mPendingCheckIn + // Accessing mPendingCheckIn should only be done while holding ChipStackLock assertChipStackLockedByCurrentThread(); NodeId nodeId = clientInfo.peer_node.GetNodeId(); auto it = mPendingCheckIn.find(nodeId); @@ -68,9 +68,12 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate return; } - // TODO(#33221): If there is a failure in sending the message this request just gets dropped. - // Work to see if there should be update to spec on whether some sort of failure later on - // Should be indicated in some manner, or identify a better recovery mechanism here. + // TODO https://github.com/CHIP-Specifications/connectedhomeip-spec/issues/10448. Spec does + // not define what to do if we fail to send the StayActiveRequest. We are assuming that any + // further attempts to send a StayActiveRequest will result in a similar failure. Because + // there is no mechanism for us to communicate with the client that sent out the KeepActive + // command that there was a failure, we simply fail silently. After spec issue is + // addressed, we can implement what spec defines here. auto onDone = [=](uint32_t promisedActiveDuration) { ActiveChanged(nodeId, promisedActiveDuration); }; CHIP_ERROR err = StayActiveSender::SendStayActiveCommand(checkInData.mStayActiveDurationMs, clientInfo.peer_node, chip::app::InteractionModelEngine::GetInstance(), onDone); @@ -160,7 +163,7 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate void ScheduleSendingKeepActiveOnCheckIn(NodeId nodeId, uint32_t stayActiveDurationMs, uint32_t timeoutMs) { - // Needs for accessing mPendingCheckIn + // Accessing mPendingCheckIn should only be done while holding ChipStackLock assertChipStackLockedByCurrentThread(); auto timeNow = System::SystemClock().GetMonotonicTimestamp(); From 669c20028d40ab4cd8d508c3af8b827e34f9659a Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Wed, 18 Sep 2024 00:22:39 +0200 Subject: [PATCH 06/47] Rename metadata_parser module to chip.testing (#35615) * Rename metadata_parser module to chip.testing * MCORE_FS_1_4: Use Subprocess from chip.testing * MCORE_FS_1_3: Use Subprocess from chip.testing * Cleanup unused arguments * Restyled by isort * Fix test case to work on CI --- BUILD.gn | 6 +- .../fabric-admin/scripts/fabric-sync-app.py | 9 +- scripts/build_python.sh | 2 +- scripts/tests/run_python_test.py | 2 +- src/python_testing/TC_MCORE_FS_1_3.py | 59 ++------ src/python_testing/TC_MCORE_FS_1_4.py | 137 +++++------------- .../matter_testing_infrastructure/BUILD.gn | 13 +- .../testing}/__init__.py | 0 .../testing}/metadata.py | 1 - .../chip/testing/tasks.py | 124 ++++++++++++++++ .../testing}/test_metadata.py | 0 .../chip/testing/test_tasks.py | 35 +++++ .../matter_testing_infrastructure/setup.cfg | 8 +- .../matter_testing_infrastructure/setup.py | 3 - 14 files changed, 228 insertions(+), 171 deletions(-) rename src/python_testing/matter_testing_infrastructure/{metadata_parser => chip/testing}/__init__.py (100%) rename src/python_testing/matter_testing_infrastructure/{metadata_parser => chip/testing}/metadata.py (99%) create mode 100644 src/python_testing/matter_testing_infrastructure/chip/testing/tasks.py rename src/python_testing/matter_testing_infrastructure/{metadata_parser => chip/testing}/test_metadata.py (100%) create mode 100644 src/python_testing/matter_testing_infrastructure/chip/testing/test_tasks.py diff --git a/BUILD.gn b/BUILD.gn index 9a0654a5dfc0aa..e05f14312d8a1a 100644 --- a/BUILD.gn +++ b/BUILD.gn @@ -81,7 +81,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { "//examples/common/pigweed/rpc_console/py:chip_rpc", "//integrations/mobly:chip_mobly", "//scripts/py_matter_yamltests:matter_yamltests", - "//src/python_testing/matter_testing_infrastructure:metadata_parser", + "//src/python_testing/matter_testing_infrastructure:chip-testing", ] pw_python_venv("matter_build_venv") { @@ -122,7 +122,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { deps = [ "${chip_root}/scripts:matter_yamltests_distribution.wheel", "${chip_root}/src/controller/python:chip-repl", - "${chip_root}/src/python_testing/matter_testing_infrastructure:metadata_parser.wheel", + "${chip_root}/src/python_testing/matter_testing_infrastructure:chip-testing.wheel", ] } } @@ -249,7 +249,7 @@ if (current_toolchain != "${dir_pw_toolchain}/default:default") { "//scripts/py_matter_idl:matter_idl.tests", "//scripts/py_matter_yamltests:matter_yamltests.tests", "//src:tests_run", - "//src/python_testing/matter_testing_infrastructure:metadata_parser.tests", + "//src/python_testing/matter_testing_infrastructure:chip-testing.tests", ] if (current_os == "linux" || current_os == "mac") { diff --git a/examples/fabric-admin/scripts/fabric-sync-app.py b/examples/fabric-admin/scripts/fabric-sync-app.py index 78e8f84f0e1523..3967f97478940e 100755 --- a/examples/fabric-admin/scripts/fabric-sync-app.py +++ b/examples/fabric-admin/scripts/fabric-sync-app.py @@ -79,12 +79,11 @@ async def forward_stdin(f_out: asyncio.StreamWriter): class Subprocess: - def __init__(self, tag: str, program: str, *args, stdout_cb=None): + def __init__(self, tag: str, program: str, *args): self.event = asyncio.Event() self.tag = tag.encode() self.program = program self.args = args - self.stdout_cb = stdout_cb self.expected_output = None def _check_output(self, line: bytes): @@ -122,8 +121,7 @@ def terminate(self): self.p.terminate() -async def run_admin(program, stdout_cb=None, storage_dir=None, - rpc_admin_port=None, rpc_bridge_port=None, +async def run_admin(program, storage_dir=None, rpc_admin_port=None, rpc_bridge_port=None, paa_trust_store_path=None, commissioner_name=None, commissioner_node_id=None, commissioner_vendor_id=None): args = [] @@ -141,8 +139,7 @@ async def run_admin(program, stdout_cb=None, storage_dir=None, args.extend(["--commissioner-nodeid", str(commissioner_node_id)]) if commissioner_vendor_id is not None: args.extend(["--commissioner-vendor-id", str(commissioner_vendor_id)]) - p = Subprocess("[FS-ADMIN]", program, "interactive", "start", *args, - stdout_cb=stdout_cb) + p = Subprocess("[FS-ADMIN]", program, "interactive", "start", *args) await p.run() return p diff --git a/scripts/build_python.sh b/scripts/build_python.sh index eaf1ad9c0e3050..da3fe0cbedf733 100755 --- a/scripts/build_python.sh +++ b/scripts/build_python.sh @@ -198,7 +198,7 @@ ninja -C "$OUTPUT_ROOT" python_wheels WHEEL=("$OUTPUT_ROOT"/controller/python/chip*.whl) # Add the matter_testing_infrastructure wheel -WHEEL+=("$OUTPUT_ROOT"/python/obj/src/python_testing/matter_testing_infrastructure/metadata_parser._build_wheel/metadata_parser-*.whl) +WHEEL+=("$OUTPUT_ROOT"/python/obj/src/python_testing/matter_testing_infrastructure/chip-testing._build_wheel/chip_testing-*.whl) if [ -n "$extra_packages" ]; then WHEEL+=("$extra_packages") diff --git a/scripts/tests/run_python_test.py b/scripts/tests/run_python_test.py index eb8f0633c0a91a..6474819312f5fb 100755 --- a/scripts/tests/run_python_test.py +++ b/scripts/tests/run_python_test.py @@ -31,8 +31,8 @@ import click import coloredlogs +from chip.testing.metadata import Metadata, MetadataReader from colorama import Fore, Style -from metadata_parser.metadata import Metadata, MetadataReader DEFAULT_CHIP_ROOT = os.path.abspath( os.path.join(os.path.dirname(__file__), '..', '..')) diff --git a/src/python_testing/TC_MCORE_FS_1_3.py b/src/python_testing/TC_MCORE_FS_1_3.py index 2a21c977c9fc8b..1270b5682e8ad2 100644 --- a/src/python_testing/TC_MCORE_FS_1_3.py +++ b/src/python_testing/TC_MCORE_FS_1_3.py @@ -36,67 +36,33 @@ import logging import os import random -import subprocess -import sys import tempfile -import threading import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import Status +from chip.testing.tasks import Subprocess from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts -# TODO: Make this class more generic. Issue #35348 -class Subprocess(threading.Thread): - - def __init__(self, args: list = [], tag="", **kw): - super().__init__(**kw) - self.tag = f"[{tag}] " if tag else "" - self.args = args - - def forward_f(self, f_in, f_out): - while True: - line = f_in.readline() - if not line: - break - f_out.write(f"{self.tag}{line}") - f_out.flush() - - def run(self): - logging.info("RUN: %s", " ".join(self.args)) - self.p = subprocess.Popen(self.args, errors="ignore", stdin=subprocess.PIPE, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - # Forward stdout and stderr with a tag attached. - t1 = threading.Thread(target=self.forward_f, args=[self.p.stdout, sys.stdout]) - t1.start() - t2 = threading.Thread(target=self.forward_f, args=[self.p.stderr, sys.stderr]) - t2.start() - # Wait for the process to finish. - self.p.wait() - t1.join() - t2.join() - - def stop(self): - self.p.terminate() - self.join() - - class AppServer: def __init__(self, app, storage_dir, port=None, discriminator=None, passcode=None): - - args = [app] - args.extend(["--KVS", tempfile.mkstemp(dir=storage_dir, prefix="kvs-app-")[1]]) + args = [ + "--KVS", tempfile.mkstemp(dir=storage_dir, prefix="kvs-app-")[1], + ] args.extend(['--secured-device-port', str(port)]) args.extend(["--discriminator", str(discriminator)]) args.extend(["--passcode", str(passcode)]) - self.app = Subprocess(args, tag="SERVER") - self.app.start() + self.app = Subprocess(app, *args, prefix="[SERVER]") + + def start(self): + # Start process and block until it prints the expected output. + self.app.start(expected_output="Server initialization complete") - def stop(self): - self.app.stop() + def terminate(self): + self.app.terminate() class TC_MCORE_FS_1_3(MatterBaseTest): @@ -134,10 +100,11 @@ def setup_class(self): port=self.th_server_port, discriminator=self.th_server_discriminator, passcode=self.th_server_passcode) + self.th_server.start() def teardown_class(self): if self.th_server is not None: - self.th_server.stop() + self.th_server.terminate() if self.storage is not None: self.storage.cleanup() super().teardown_class() diff --git a/src/python_testing/TC_MCORE_FS_1_4.py b/src/python_testing/TC_MCORE_FS_1_4.py index c776bd2e9fce7e..7b101bb9273349 100644 --- a/src/python_testing/TC_MCORE_FS_1_4.py +++ b/src/python_testing/TC_MCORE_FS_1_4.py @@ -36,86 +36,32 @@ import logging import os import random -import subprocess -import sys import tempfile -import threading import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import Status +from chip.testing.tasks import Subprocess from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts -# TODO: Make this class more generic. Issue #35348 - - -class Subprocess(threading.Thread): - - def __init__(self, args: list = [], stdout_cb=None, tag="", **kw): - super().__init__(**kw) - self.tag = f"[{tag}] " if tag else "" - self.stdout_cb = stdout_cb - self.args = args - - def forward_f(self, f_in, f_out): - while True: - line = f_in.readline() - if not line: - break - f_out.write(f"{self.tag}{line}") - f_out.flush() - if self.stdout_cb is not None: - self.stdout_cb(line) - - def run(self): - logging.info("RUN: %s", " ".join(self.args)) - self.p = subprocess.Popen(self.args, errors="ignore", stdin=subprocess.PIPE, - stdout=subprocess.PIPE, stderr=subprocess.PIPE) - # Forward stdout and stderr with a tag attached. - forwarding_stdout_thread = threading.Thread(target=self.forward_f, args=[self.p.stdout, sys.stdout]) - forwarding_stdout_thread.start() - forwarding_stderr_thread = threading.Thread(target=self.forward_f, args=[self.p.stderr, sys.stderr]) - forwarding_stderr_thread.start() - # Wait for the process to finish. - self.p.wait() - forwarding_stdout_thread.join() - forwarding_stderr_thread.join() - - def stop(self): - self.p.terminate() - self.join() - class FabricSyncApp: - def _process_admin_output(self, line): - if self.wait_for_text_text is not None and self.wait_for_text_text in line: - self.wait_for_text_event.set() - - def wait_for_text(self, timeout=30): - if not self.wait_for_text_event.wait(timeout=timeout): - raise Exception(f"Timeout waiting for text: {self.wait_for_text_text}") - self.wait_for_text_event.clear() - self.wait_for_text_text = None - def __init__(self, fabric_sync_app_path, fabric_admin_app_path, fabric_bridge_app_path, storage_dir, fabric_name=None, node_id=None, vendor_id=None, paa_trust_store_path=None, bridge_port=None, bridge_discriminator=None, bridge_passcode=None): - - self.wait_for_text_event = threading.Event() - self.wait_for_text_text = None - - args = [fabric_sync_app_path] - args.append(f"--app-admin={fabric_admin_app_path}") - args.append(f"--app-bridge={fabric_bridge_app_path}") - # Override default ports, so it will be possible to run - # our TH_FSA alongside the DUT_FSA during CI testing. - args.append("--app-admin-rpc-port=44000") - args.append("--app-bridge-rpc-port=44001") - # Keep the storage directory in a temporary location. - args.append(f"--storage-dir={storage_dir}") + args = [ + f"--app-admin={fabric_admin_app_path}", + f"--app-bridge={fabric_bridge_app_path}", + # Override default ports, so it will be possible to run + # our TH_FSA alongside the DUT_FSA during CI testing. + "--app-admin-rpc-port=44000", + "--app-bridge-rpc-port=44001", + # Keep the storage directory in a temporary location. + f"--storage-dir={storage_dir}", + ] if paa_trust_store_path is not None: args.append(f"--paa-trust-store-path={paa_trust_store_path}") if fabric_name is not None: @@ -127,55 +73,38 @@ def __init__(self, fabric_sync_app_path, fabric_admin_app_path, fabric_bridge_ap args.append(f"--discriminator={bridge_discriminator}") args.append(f"--passcode={bridge_passcode}") - self.fabric_sync_app = Subprocess(args, stdout_cb=self._process_admin_output) - self.wait_for_text_text = "Successfully opened pairing window on the device" - self.fabric_sync_app.start() + self.fabric_sync_app = Subprocess(fabric_sync_app_path, *args) - # Wait for the fabric-sync-app to be ready. - self.wait_for_text() + def start(self): + # Start process and block until it prints the expected output. + self.fabric_sync_app.start(expected_output="Successfully opened pairing window on the device") - def commission_on_network(self, node_id, setup_pin_code=None, filter_type=None, filter=None): - self.wait_for_text_text = f"Commissioning complete for node ID {node_id:#018x}: success" - # Send the commissioning command to the admin. - self.fabric_sync_app.p.stdin.write(f"pairing onnetwork {node_id} {setup_pin_code}\n") - self.fabric_sync_app.p.stdin.flush() - # Wait for success message. - self.wait_for_text() + def terminate(self): + self.fabric_sync_app.terminate() - def stop(self): - self.fabric_sync_app.stop() + def commission_on_network(self, node_id, setup_pin_code=None, filter_type=None, filter=None): + self.fabric_sync_app.send( + f"pairing onnetwork {node_id} {setup_pin_code}", + expected_output=f"Commissioning complete for node ID {node_id:#018x}: success") class AppServer: - def _process_admin_output(self, line): - if self.wait_for_text_text is not None and self.wait_for_text_text in line: - self.wait_for_text_event.set() - - def wait_for_text(self, timeout=30): - if not self.wait_for_text_event.wait(timeout=timeout): - raise Exception(f"Timeout waiting for text: {self.wait_for_text_text}") - self.wait_for_text_event.clear() - self.wait_for_text_text = None - def __init__(self, app, storage_dir, port=None, discriminator=None, passcode=None): - self.wait_for_text_event = threading.Event() - self.wait_for_text_text = None - - args = [app] - args.extend(["--KVS", tempfile.mkstemp(dir=storage_dir, prefix="kvs-app-")[1]]) + args = [ + "--KVS", tempfile.mkstemp(dir=storage_dir, prefix="kvs-app-")[1], + ] args.extend(['--secured-device-port', str(port)]) args.extend(["--discriminator", str(discriminator)]) args.extend(["--passcode", str(passcode)]) - self.app = Subprocess(args, stdout_cb=self._process_admin_output, tag="SERVER") - self.wait_for_text_text = "Server initialization complete" - self.app.start() + self.app = Subprocess(app, *args, prefix="[SERVER]") - # Wait for the server-app to be ready. - self.wait_for_text() + def start(self): + # Start process and block until it prints the expected output. + self.app.start(expected_output="Server initialization complete") - def stop(self): - self.app.stop() + def terminate(self): + self.app.terminate() class TC_MCORE_FS_1_4(MatterBaseTest): @@ -237,6 +166,7 @@ def setup_class(self): bridge_discriminator=self.th_fsa_bridge_discriminator, bridge_passcode=self.th_fsa_bridge_passcode, vendor_id=0xFFF1) + self.th_fsa_controller.start() # Get the named pipe path for the DUT_FSA app input from the user params. dut_fsa_stdin_pipe = self.user_params.get("dut_fsa_stdin_pipe", None) @@ -254,12 +184,13 @@ def setup_class(self): port=self.th_server_port, discriminator=self.th_server_discriminator, passcode=self.th_server_passcode) + self.th_server.start() def teardown_class(self): if self.th_fsa_controller is not None: - self.th_fsa_controller.stop() + self.th_fsa_controller.terminate() if self.th_server is not None: - self.th_server.stop() + self.th_server.terminate() if self.storage is not None: self.storage.cleanup() super().teardown_class() diff --git a/src/python_testing/matter_testing_infrastructure/BUILD.gn b/src/python_testing/matter_testing_infrastructure/BUILD.gn index f972040a3e64b5..c8d54fb0084c92 100644 --- a/src/python_testing/matter_testing_infrastructure/BUILD.gn +++ b/src/python_testing/matter_testing_infrastructure/BUILD.gn @@ -18,7 +18,8 @@ import("//build_overrides/chip.gni") import("//build_overrides/pigweed.gni") import("$dir_pw_build/python.gni") -pw_python_package("metadata_parser") { +# Python package for CHIP testing support. +pw_python_package("chip-testing") { setup = [ "setup.py", "setup.cfg", @@ -28,9 +29,13 @@ pw_python_package("metadata_parser") { inputs = [ "env_test.yaml" ] sources = [ - "metadata_parser/__init__.py", - "metadata_parser/metadata.py", + "chip/testing/__init__.py", + "chip/testing/metadata.py", + "chip/testing/tasks.py", ] - tests = [ "metadata_parser/test_metadata.py" ] + tests = [ + "chip/testing/test_metadata.py", + "chip/testing/test_tasks.py", + ] } diff --git a/src/python_testing/matter_testing_infrastructure/metadata_parser/__init__.py b/src/python_testing/matter_testing_infrastructure/chip/testing/__init__.py similarity index 100% rename from src/python_testing/matter_testing_infrastructure/metadata_parser/__init__.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/__init__.py diff --git a/src/python_testing/matter_testing_infrastructure/metadata_parser/metadata.py b/src/python_testing/matter_testing_infrastructure/chip/testing/metadata.py similarity index 99% rename from src/python_testing/matter_testing_infrastructure/metadata_parser/metadata.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/metadata.py index f16d3e9803e825..aa829c40d855c7 100644 --- a/src/python_testing/matter_testing_infrastructure/metadata_parser/metadata.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/metadata.py @@ -1,4 +1,3 @@ -#!/usr/bin/python3 # Copyright (c) 2024 Project CHIP Authors # # Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/tasks.py b/src/python_testing/matter_testing_infrastructure/chip/testing/tasks.py new file mode 100644 index 00000000000000..873cec5e7c234e --- /dev/null +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/tasks.py @@ -0,0 +1,124 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import logging +import subprocess +import sys +import threading +import typing + + +def forward_f(prefix: bytes, + f_in: typing.BinaryIO, + f_out: typing.BinaryIO, + cb: typing.Optional[typing.Callable[[bytes, bool], None]] = None, + is_stderr: bool = False): + """Forward f_in to f_out with a prefix attached. + + This function can optionally feed received lines to a callback function. + """ + while True: + line = f_in.readline() + if not line: + break + if cb is not None: + cb(line, is_stderr) + f_out.buffer.write(prefix) + f_out.buffer.write(line) + f_out.flush() + + +class Subprocess(threading.Thread): + """Run a subprocess and optionally prefix its output.""" + + def __init__(self, program: str, *args: typing.List[str], prefix: str = "", + output_cb: typing.Optional[typing.Callable[[bytes, bool], None]] = None): + """Initialize the subprocess. + + Args: + program: The program to run. + args: The arguments to the program. + prefix: A prefix to attach to the output. + output_cb: A callback function to process the output. It should take two + arguments: the output line bytes and the boolean indicating if the + output comes from stderr. + """ + super().__init__() + self.event = threading.Event() + self.prefix = prefix.encode() + self.program = program + self.args = args + self.output_cb = output_cb + self.expected_output = None + + def _check_output(self, line: bytes, is_stderr: bool): + if self.output_cb is not None: + self.output_cb(line, is_stderr) + if self.expected_output is not None and self.expected_output in line: + self.event.set() + + def run(self): + """Thread entry point.""" + + logging.info("RUN: %s %s", self.program, " ".join(self.args)) + self.p = subprocess.Popen([self.program] + list(self.args), + stdin=subprocess.PIPE, + stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + + # Forward stdout and stderr with a tag attached. + forwarding_stdout_thread = threading.Thread( + target=forward_f, + args=(self.prefix, self.p.stdout, sys.stdout, self._check_output)) + forwarding_stdout_thread.start() + forwarding_stderr_thread = threading.Thread( + target=forward_f, + args=(self.prefix, self.p.stderr, sys.stderr, self._check_output, True)) + forwarding_stderr_thread.start() + + # Wait for the process to finish. + self.p.wait() + + forwarding_stdout_thread.join() + forwarding_stderr_thread.join() + + def start(self, expected_output: str = None, timeout: float = None): + """Start a subprocess and optionally wait for a specific output.""" + if expected_output is not None: + self.expected_output = expected_output.encode() + self.event.clear() + super().start() + if expected_output is not None: + if self.event.wait(timeout) is False: + raise TimeoutError("Expected output not found") + self.expected_output = None + + def send(self, message: str, end: str = "\n", + expected_output: str = None, timeout: float = None): + """Send a message to a process and optionally wait for a response.""" + + if expected_output is not None: + self.expected_output = expected_output.encode() + self.event.clear() + + self.p.stdin.write((message + end).encode()) + self.p.stdin.flush() + + if expected_output is not None: + if self.event.wait(timeout) is False: + raise TimeoutError("Expected output not found") + self.expected_output = None + + def terminate(self): + self.p.terminate() diff --git a/src/python_testing/matter_testing_infrastructure/metadata_parser/test_metadata.py b/src/python_testing/matter_testing_infrastructure/chip/testing/test_metadata.py similarity index 100% rename from src/python_testing/matter_testing_infrastructure/metadata_parser/test_metadata.py rename to src/python_testing/matter_testing_infrastructure/chip/testing/test_metadata.py diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/test_tasks.py b/src/python_testing/matter_testing_infrastructure/chip/testing/test_tasks.py new file mode 100644 index 00000000000000..5e91a89cf68581 --- /dev/null +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/test_tasks.py @@ -0,0 +1,35 @@ +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +import unittest + +from tasks import Subprocess + + +class TestSubprocess(unittest.TestCase): + + def test_expected_output(self): + p = Subprocess("python3", "-c", "print('Hello, World!')") + p.start(expected_output="Hello, World!", timeout=1) + p.terminate() + + def test_expected_output_timeout(self): + p = Subprocess("python3", "--version") + with self.assertRaises(TimeoutError): + p.start(expected_output="Python 1.0.0", timeout=1) + p.terminate() + + +if __name__ == "__main__": + unittest.main() diff --git a/src/python_testing/matter_testing_infrastructure/setup.cfg b/src/python_testing/matter_testing_infrastructure/setup.cfg index d1cbadff10880c..862236aa038746 100644 --- a/src/python_testing/matter_testing_infrastructure/setup.cfg +++ b/src/python_testing/matter_testing_infrastructure/setup.cfg @@ -13,7 +13,9 @@ # limitations under the License. [metadata] -name = metadata_parser -version = 0.0.1 +name = chip-testing +version = 1.0.0 author = Project CHIP Authors -description = Scripts to get metadata (runner arguments) associated with the python_testing scripts \ No newline at end of file +license-expression = Apache-2.0 +description = Various helpers associated with the python_testing scripts +url = https://github.com/project-chip/connectedhomeip diff --git a/src/python_testing/matter_testing_infrastructure/setup.py b/src/python_testing/matter_testing_infrastructure/setup.py index 8a92fbd313d1c7..ab0a7f39adca20 100644 --- a/src/python_testing/matter_testing_infrastructure/setup.py +++ b/src/python_testing/matter_testing_infrastructure/setup.py @@ -12,9 +12,6 @@ # See the License for the specific language governing permissions and # limitations under the License. - -"""The metadata_parser package.""" - import setuptools # type: ignore setuptools.setup() # Package definition in setup.cfg From 44024ca47217440853e368e8e6bc3c7d4f7d5c25 Mon Sep 17 00:00:00 2001 From: Tennessee Carmel-Veilleux Date: Tue, 17 Sep 2024 19:31:53 -0400 Subject: [PATCH 07/47] Remove all un-specified draft clusters from SDK (#35583) * Start removing Binary Input * Remove Binary Input Basic cluster (not in spec) * Remove the rest of draft clusters * Remove leftover bits * Restyled by prettier-json * Restyled by prettier-markdown * Run zap_convert_all * Regen ZAP * Fix build * Kick restyle * remove dead file --------- Co-authored-by: Restyled.io --- .github/workflows/tests.yaml | 4 - docs/zap_clusters.md | 4 - .../air-purifier-common/air-purifier-app.zap | 18 - .../air-quality-sensor-app.zap | 18 - .../all-clusters-app.matter | 287 - .../all-clusters-common/all-clusters-app.zap | 562 - .../esp32/main/CMakeLists.txt | 1 - .../all-clusters-minimal-app.zap | 18 - .../esp32/main/CMakeLists.txt | 381 +- .../bridge-app/bridge-common/bridge-app.zap | 72 +- ...noip_rootnode_dimmablelight_bCwGYSDpoe.zap | 90 +- .../rootnode_airpurifier_73a6fe2651.zap | 18 - .../rootnode_airqualitysensor_e63187f6c9.zap | 18 - .../rootnode_basicvideoplayer_0ff86e943b.zap | 18 - ...tnode_colortemperaturelight_hbUnzYVeyn.zap | 18 - .../rootnode_contactsensor_27f76aeaf5.zap | 18 - .../rootnode_contactsensor_lFAGG1bfRO.zap | 54 +- .../rootnode_dimmablelight_bCwGYSDpoe.zap | 90 +- ...rootnode_dimmablepluginunit_f8a9a0b9d4.zap | 90 +- .../devices/rootnode_doorlock_aNKYAreMXE.zap | 18 - ...rootnode_extendedcolorlight_8lcaaYJVAa.zap | 38 +- .../chef/devices/rootnode_fan_7N2TobIlOX.zap | 18 - .../rootnode_flowsensor_1zVxHedlaV.zap | 90 +- ...rootnode_heatingcoolingunit_ncdGai1E5a.zap | 90 +- .../rootnode_humiditysensor_Xyj4gda6Hb.zap | 90 +- .../rootnode_lightsensor_lZQycTFcJK.zap | 58 +- .../rootnode_occupancysensor_iHyVgifZuo.zap | 90 +- .../rootnode_onofflight_bbs1b7IaOV.zap | 38 +- .../devices/rootnode_onofflight_samplemei.zap | 38 +- .../rootnode_onofflightswitch_FsPlMr090Q.zap | 56 +- .../rootnode_onoffpluginunit_Wtf8ss5EBY.zap | 54 +- .../rootnode_pressuresensor_s0qC9wLH4k.zap | 58 +- .../devices/rootnode_speaker_RpzeXdimqA.zap | 54 +- .../rootnode_temperaturesensor_Qy1zkNW7c3.zap | 90 +- .../rootnode_thermostat_bm3fb8dhYi.zap | 198 +- .../rootnode_windowcovering_RLCxaGi9Yx.zap | 38 +- .../chef/sample_app_util/zap_file_parser.py | 9 +- examples/chip-tool/README.md | 35 - .../pigweed/protos/attributes_service.proto | 9 - .../contact-sensor-app.zap | 18 - .../nxp/zap-lit/contact-sensor-app.zap | 18 - .../nxp/zap-sit/contact-sensor-app.zap | 18 - examples/darwin-framework-tool/README.md | 1 - .../esp32/main/CMakeLists.txt | 364 +- .../fabric-bridge-app.zap | 36 +- .../nxp/zap/laundry-washer-app.zap | 18 - .../ameba/main/DeviceCallbacks.cpp | 11 - .../ameba/main/include/DeviceCallbacks.h | 2 - .../asr/src/DeviceCallbacks.cpp | 8 +- .../cc13x4_26x4/src/ZclCallbacks.cpp | 7 +- .../esp32/main/DeviceCallbacks.cpp | 10 - .../esp32/main/include/DeviceCallbacks.h | 2 - .../genio/src/ZclCallbacks.cpp | 9 +- .../infineon/cyw30739/src/ZclCallbacks.cpp | 4 - .../light-switch-common/light-switch-app.zap | 90 - examples/light-switch-app/qpg/zap/switch.zap | 188 - .../silabs/src/ZclCallbacks.cpp | 9 +- .../telink/src/ZclCallbacks.cpp | 10 +- .../lighting-common/lighting-app.zap | 18 - .../bouffalolab/common/ZclCallbacks.cpp | 6 - .../data_model/lighting-app-ethernet.zap | 18 - .../data_model/lighting-app-thread.zap | 18 - .../data_model/lighting-app-wifi.zap | 18 - .../lighting-app/genio/src/ZclCallbacks.cpp | 7 - .../infineon/psoc6/src/ZclCallbacks.cpp | 7 - .../lighting-common/lighting-app.zap | 18 - .../nxp/common/DeviceCallbacks.cpp | 7 - .../nxp/k32w0/main/ZclCallbacks.cpp | 7 - .../lighting-app/nxp/zap/lighting-on-off.zap | 18 - examples/lighting-app/qpg/zap/light.zap | 34 - .../silabs/data_model/lighting-thread-app.zap | 18 - .../silabs/data_model/lighting-wifi-app.zap | 18 - .../lighting-app/silabs/src/ZclCallbacks.cpp | 7 - examples/lock-app/lock-common/lock-app.zap | 18 - examples/lock-app/qpg/zap/lock.zap | 34 - .../network-manager-app.matter | 2 - .../network-manager-app.zap | 22 +- .../ota-provider-common/ota-provider-app.zap | 20 +- .../ota-requestor-app.zap | 34 - .../placeholder/linux/apps/app1/config.zap | 758 +- .../placeholder/linux/apps/app2/config.zap | 702 +- examples/pump-app/pump-common/pump-app.zap | 70 +- .../silabs/data_model/pump-thread-app.zap | 70 +- .../silabs/data_model/pump-wifi-app.zap | 70 +- .../pump-controller-app.zap | 212 +- .../smoke-co-alarm-app.zap | 18 - .../temperature-measurement.zap | 18 - .../nxp/zap/thermostat_matter_thread.zap | 52 - .../nxp/zap/thermostat_matter_wifi.zap | 52 - .../qpg/zap/thermostaticRadiatorValve.zap | 36 - .../thermostat-common/thermostat.zap | 36 - examples/tv-app/tv-common/tv-app.zap | 124 +- .../tv-casting-common/tv-casting-app.matter | 29 - .../tv-casting-common/tv-casting-app.zap | 699 +- examples/window-app/common/window-app.zap | 18 - .../inputs/large_all_clusters_app.matter | 71 - .../cpp-app/PluginApplicationCallbacks.h | 6 - .../cpp-app/callback-stub.cpp | 15 - .../cpp-app/cluster-init-callback.cpp | 9 - scripts/rules.matterlint | 4 - scripts/tests/chiptest/__init__.py | 1 - .../zap/tests/inputs/all-clusters-app.zap | 562 - .../tools/zap/tests/inputs/lighting-app.zap | 18 - .../app-templates/IMClusterCommandHandler.cpp | 49 - .../app-templates/endpoint_config.h | 420 +- .../app-templates/gen_config.h | 24 - src/app/chip_data_model.gni | 1 - .../barrier-control-server.cpp | 370 - .../barrier-control-server.h | 53 - src/app/tests/suites/README.md | 80 +- .../tests/suites/certification/information.py | 175 - src/app/tests/suites/certification/tests.yaml | 300 - src/app/util/util.cpp | 2 - .../zcl/data-model/chip/matter-devices.xml | 4 - .../zcl/data-model/draft/README.md | 8 - .../draft/barrier-control-cluster.xml | 69 - .../draft/electrical-measurement-cluster.xml | 202 - .../draft/input-output-value-clusters.xml | 41 - .../onoff-switch-configuration-cluster.xml | 34 - .../zcl/zcl-with-test-extensions.json | 5 - src/app/zap-templates/zcl/zcl.json | 11 +- src/app/zap_cluster_list.json | 16 +- .../data_model/controller-clusters.matter | 244 - .../data_model/controller-clusters.zap | 2862 +--- .../chip/devicecontroller/ChipClusters.java | 5360 +------ .../devicecontroller/ClusterIDMapping.java | 599 - .../devicecontroller/ClusterInfoMapping.java | 440 - .../devicecontroller/ClusterReadMapping.java | 1923 --- .../devicecontroller/ClusterWriteMapping.java | 470 - .../cluster/clusters/BarrierControlCluster.kt | 1817 --- .../clusters/BinaryInputBasicCluster.kt | 1671 -- .../clusters/ElectricalMeasurementCluster.kt | 12934 ---------------- .../OnOffSwitchConfigurationCluster.kt | 840 - .../java/matter/controller/cluster/files.gni | 4 - .../CHIPAttributeTLVValueDecoder.cpp | 2940 ---- .../CHIPEventTLVValueDecoder.cpp | 40 - .../python/chip/clusters/CHIPClusters.py | 1127 -- .../python/chip/clusters/Objects.py | 3292 ---- .../zap-generated/attributes/Accessors.cpp | 7665 +-------- .../zap-generated/attributes/Accessors.h | 966 -- .../app-common/zap-generated/callback.h | 198 - .../app-common/zap-generated/cluster-enums.h | 24 - .../zap-generated/cluster-objects.cpp | 660 - .../zap-generated/cluster-objects.h | 2453 --- .../app-common/zap-generated/ids/Attributes.h | 716 - .../app-common/zap-generated/ids/Clusters.h | 12 - .../app-common/zap-generated/ids/Commands.h | 36 - .../zap-generated/cluster/Commands.h | 1342 +- .../cluster/logging/DataModelLogger.cpp | 1082 +- .../cluster/logging/DataModelLogger.h | 6 - .../cluster/logging/EntryToText.cpp | 415 - .../zap-generated/cluster/Commands.h | 4 - 152 files changed, 1093 insertions(+), 60683 deletions(-) delete mode 100644 src/app/clusters/barrier-control-server/barrier-control-server.cpp delete mode 100644 src/app/clusters/barrier-control-server/barrier-control-server.h delete mode 100755 src/app/tests/suites/certification/information.py delete mode 100644 src/app/tests/suites/certification/tests.yaml delete mode 100644 src/app/zap-templates/zcl/data-model/draft/README.md delete mode 100644 src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml delete mode 100644 src/app/zap-templates/zcl/data-model/draft/electrical-measurement-cluster.xml delete mode 100644 src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters.xml delete mode 100644 src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml delete mode 100644 src/controller/java/generated/java/matter/controller/cluster/clusters/BarrierControlCluster.kt delete mode 100644 src/controller/java/generated/java/matter/controller/cluster/clusters/BinaryInputBasicCluster.kt delete mode 100644 src/controller/java/generated/java/matter/controller/cluster/clusters/ElectricalMeasurementCluster.kt delete mode 100644 src/controller/java/generated/java/matter/controller/cluster/clusters/OnOffSwitchConfigurationCluster.kt diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index a9620b617e5938..d14d188a2fb6e4 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -202,10 +202,6 @@ jobs: src/app/zap-templates/zcl/data-model/chip/window-covering.xml \ src/app/zap-templates/zcl/data-model/chip/temperature-control-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/matter-devices.xml \ - src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml \ - src/app/zap-templates/zcl/data-model/draft/electrical-measurement-cluster.xml \ - src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters.xml \ - src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml \ src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml \ diff --git a/docs/zap_clusters.md b/docs/zap_clusters.md index 93e37131626379..41679143b5c428 100644 --- a/docs/zap_clusters.md +++ b/docs/zap_clusters.md @@ -15,9 +15,7 @@ Generally regenerate using one of: | 3 | 0x03 | Identify | | 4 | 0x04 | Groups | | 6 | 0x06 | OnOff | -| 7 | 0x07 | OnOffSwitchConfiguration | | 8 | 0x08 | LevelControl | -| 15 | 0x0F | BinaryInputBasic | | 28 | 0x1C | PulseWidthModulation | | 29 | 0x1D | Descriptor | | 30 | 0x1E | Binding | @@ -91,7 +89,6 @@ Generally regenerate using one of: | 159 | 0x9F | DeviceEnergyManagementMode | | 257 | 0x101 | DoorLock | | 258 | 0x102 | WindowCovering | -| 259 | 0x103 | BarrierControl | | 336 | 0x150 | ServiceArea | | 512 | 0x200 | PumpConfigurationAndControl | | 513 | 0x201 | Thermostat | @@ -134,7 +131,6 @@ Generally regenerate using one of: | 1296 | 0x510 | ContentAppObserver | | 1872 | 0x750 | EcosystemInformation | | 1873 | 0x751 | CommissionerControl | -| 2820 | 0xB04 | ElectricalMeasurement | | 4294048773 | 0xFFF1FC05 | UnitTesting | | 4294048774 | 0xFFF1FC06 | FaultInjection | | 4294048800 | 0xFFF1FC20 | SampleMei | diff --git a/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap b/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap index 0ffbbd01e7c139..a869118b57fb33 100644 --- a/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap +++ b/examples/air-purifier-app/air-purifier-common/air-purifier-app.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap index 023a19864173c0..03d4b9edfb3669 100644 --- a/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap +++ b/examples/air-quality-sensor-app/air-quality-sensor-common/air-quality-sensor-app.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter index 1aa3c8007507d3..33a676bc15b1cf 100644 --- a/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter +++ b/examples/all-clusters-app/all-clusters-common/all-clusters-app.matter @@ -505,20 +505,6 @@ cluster OnOff = 6 { command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; } -/** Attributes and commands for configuring On/Off switching devices. */ -deprecated cluster OnOffSwitchConfiguration = 7 { - revision 1; // NOTE: Default/not specifically set - - readonly attribute enum8 switchType = 0; - attribute enum8 switchActions = 16; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ cluster LevelControl = 8 { revision 6; @@ -644,27 +630,6 @@ cluster LevelControl = 8 { command MoveToClosestFrequency(MoveToClosestFrequencyRequest): DefaultSuccess = 8; } -/** An interface for reading the value of a binary measurement and accessing various characteristics of that measurement. */ -deprecated cluster BinaryInputBasic = 15 { - revision 1; // NOTE: Default/not specifically set - - attribute optional char_string<16> activeText = 4; - attribute optional char_string<16> description = 28; - attribute optional char_string<16> inactiveText = 46; - attribute boolean outOfService = 81; - readonly attribute optional enum8 polarity = 84; - attribute boolean presentValue = 85; - attribute optional enum8 reliability = 103; - readonly attribute bitmap8 statusFlags = 111; - readonly attribute optional int32u applicationType = 256; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; @@ -5310,48 +5275,6 @@ cluster WindowCovering = 258 { command GoToTiltPercentage(GoToTiltPercentageRequest): DefaultSuccess = 8; } -/** This cluster provides control of a barrier (garage door). */ -deprecated cluster BarrierControl = 259 { - revision 1; // NOTE: Default/not specifically set - - bitmap BarrierControlCapabilities : bitmap8 { - kPartialBarrier = 0x1; - } - - bitmap BarrierControlSafetyStatus : bitmap16 { - kRemoteLockout = 0x1; - kTemperDetected = 0x2; - kFailedCommunication = 0x4; - kPositionFailure = 0x8; - } - - readonly attribute enum8 barrierMovingState = 1; - readonly attribute bitmap16 barrierSafetyStatus = 2; - readonly attribute bitmap8 barrierCapabilities = 3; - attribute optional int16u barrierOpenEvents = 4; - attribute optional int16u barrierCloseEvents = 5; - attribute optional int16u barrierCommandOpenEvents = 6; - attribute optional int16u barrierCommandCloseEvents = 7; - attribute optional int16u barrierOpenPeriod = 8; - attribute optional int16u barrierClosePeriod = 9; - readonly attribute int8u barrierPosition = 10; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct BarrierControlGoToPercentRequest { - int8u percentOpen = 0; - } - - /** Command to instruct a barrier to go to a percent open state. */ - command BarrierControlGoToPercent(BarrierControlGoToPercentRequest): DefaultSuccess = 0; - /** Command that instructs the barrier to stop moving. */ - command BarrierControlStop(): DefaultSuccess = 1; -} - /** An interface for configuring and controlling pumps. */ cluster PumpConfigurationAndControl = 512 { revision 3; @@ -7068,173 +6991,6 @@ cluster LowPower = 1288 { command Sleep(): DefaultSuccess = 0; } -/** Attributes related to the electrical properties of a device. This cluster is used by power outlets and other devices that need to provide instantaneous data as opposed to metrology data which should be retrieved from the metering cluster.. */ -deprecated cluster ElectricalMeasurement = 2820 { - revision 3; - - readonly attribute optional bitmap32 measurementType = 0; - readonly attribute optional int16s dcVoltage = 256; - readonly attribute optional int16s dcVoltageMin = 257; - readonly attribute optional int16s dcVoltageMax = 258; - readonly attribute optional int16s dcCurrent = 259; - readonly attribute optional int16s dcCurrentMin = 260; - readonly attribute optional int16s dcCurrentMax = 261; - readonly attribute optional int16s dcPower = 262; - readonly attribute optional int16s dcPowerMin = 263; - readonly attribute optional int16s dcPowerMax = 264; - readonly attribute optional int16u dcVoltageMultiplier = 512; - readonly attribute optional int16u dcVoltageDivisor = 513; - readonly attribute optional int16u dcCurrentMultiplier = 514; - readonly attribute optional int16u dcCurrentDivisor = 515; - readonly attribute optional int16u dcPowerMultiplier = 516; - readonly attribute optional int16u dcPowerDivisor = 517; - readonly attribute optional int16u acFrequency = 768; - readonly attribute optional int16u acFrequencyMin = 769; - readonly attribute optional int16u acFrequencyMax = 770; - readonly attribute optional int16u neutralCurrent = 771; - readonly attribute optional int32s totalActivePower = 772; - readonly attribute optional int32s totalReactivePower = 773; - readonly attribute optional int32u totalApparentPower = 774; - readonly attribute optional int16s measured1stHarmonicCurrent = 775; - readonly attribute optional int16s measured3rdHarmonicCurrent = 776; - readonly attribute optional int16s measured5thHarmonicCurrent = 777; - readonly attribute optional int16s measured7thHarmonicCurrent = 778; - readonly attribute optional int16s measured9thHarmonicCurrent = 779; - readonly attribute optional int16s measured11thHarmonicCurrent = 780; - readonly attribute optional int16s measuredPhase1stHarmonicCurrent = 781; - readonly attribute optional int16s measuredPhase3rdHarmonicCurrent = 782; - readonly attribute optional int16s measuredPhase5thHarmonicCurrent = 783; - readonly attribute optional int16s measuredPhase7thHarmonicCurrent = 784; - readonly attribute optional int16s measuredPhase9thHarmonicCurrent = 785; - readonly attribute optional int16s measuredPhase11thHarmonicCurrent = 786; - readonly attribute optional int16u acFrequencyMultiplier = 1024; - readonly attribute optional int16u acFrequencyDivisor = 1025; - readonly attribute optional int32u powerMultiplier = 1026; - readonly attribute optional int32u powerDivisor = 1027; - readonly attribute optional int8s harmonicCurrentMultiplier = 1028; - readonly attribute optional int8s phaseHarmonicCurrentMultiplier = 1029; - readonly attribute optional int16s instantaneousVoltage = 1280; - readonly attribute optional int16u instantaneousLineCurrent = 1281; - readonly attribute optional int16s instantaneousActiveCurrent = 1282; - readonly attribute optional int16s instantaneousReactiveCurrent = 1283; - readonly attribute optional int16s instantaneousPower = 1284; - readonly attribute optional int16u rmsVoltage = 1285; - readonly attribute optional int16u rmsVoltageMin = 1286; - readonly attribute optional int16u rmsVoltageMax = 1287; - readonly attribute optional int16u rmsCurrent = 1288; - readonly attribute optional int16u rmsCurrentMin = 1289; - readonly attribute optional int16u rmsCurrentMax = 1290; - readonly attribute optional int16s activePower = 1291; - readonly attribute optional int16s activePowerMin = 1292; - readonly attribute optional int16s activePowerMax = 1293; - readonly attribute optional int16s reactivePower = 1294; - readonly attribute optional int16u apparentPower = 1295; - readonly attribute optional int8s powerFactor = 1296; - attribute optional int16u averageRmsVoltageMeasurementPeriod = 1297; - attribute optional int16u averageRmsUnderVoltageCounter = 1299; - attribute optional int16u rmsExtremeOverVoltagePeriod = 1300; - attribute optional int16u rmsExtremeUnderVoltagePeriod = 1301; - attribute optional int16u rmsVoltageSagPeriod = 1302; - attribute optional int16u rmsVoltageSwellPeriod = 1303; - readonly attribute optional int16u acVoltageMultiplier = 1536; - readonly attribute optional int16u acVoltageDivisor = 1537; - readonly attribute optional int16u acCurrentMultiplier = 1538; - readonly attribute optional int16u acCurrentDivisor = 1539; - readonly attribute optional int16u acPowerMultiplier = 1540; - readonly attribute optional int16u acPowerDivisor = 1541; - attribute optional bitmap8 overloadAlarmsMask = 1792; - readonly attribute optional int16s voltageOverload = 1793; - readonly attribute optional int16s currentOverload = 1794; - attribute optional bitmap16 acOverloadAlarmsMask = 2048; - readonly attribute optional int16s acVoltageOverload = 2049; - readonly attribute optional int16s acCurrentOverload = 2050; - readonly attribute optional int16s acActivePowerOverload = 2051; - readonly attribute optional int16s acReactivePowerOverload = 2052; - readonly attribute optional int16s averageRmsOverVoltage = 2053; - readonly attribute optional int16s averageRmsUnderVoltage = 2054; - readonly attribute optional int16s rmsExtremeOverVoltage = 2055; - readonly attribute optional int16s rmsExtremeUnderVoltage = 2056; - readonly attribute optional int16s rmsVoltageSag = 2057; - readonly attribute optional int16s rmsVoltageSwell = 2058; - readonly attribute optional int16u lineCurrentPhaseB = 2305; - readonly attribute optional int16s activeCurrentPhaseB = 2306; - readonly attribute optional int16s reactiveCurrentPhaseB = 2307; - readonly attribute optional int16u rmsVoltagePhaseB = 2309; - readonly attribute optional int16u rmsVoltageMinPhaseB = 2310; - readonly attribute optional int16u rmsVoltageMaxPhaseB = 2311; - readonly attribute optional int16u rmsCurrentPhaseB = 2312; - readonly attribute optional int16u rmsCurrentMinPhaseB = 2313; - readonly attribute optional int16u rmsCurrentMaxPhaseB = 2314; - readonly attribute optional int16s activePowerPhaseB = 2315; - readonly attribute optional int16s activePowerMinPhaseB = 2316; - readonly attribute optional int16s activePowerMaxPhaseB = 2317; - readonly attribute optional int16s reactivePowerPhaseB = 2318; - readonly attribute optional int16u apparentPowerPhaseB = 2319; - readonly attribute optional int8s powerFactorPhaseB = 2320; - readonly attribute optional int16u averageRmsVoltageMeasurementPeriodPhaseB = 2321; - readonly attribute optional int16u averageRmsOverVoltageCounterPhaseB = 2322; - readonly attribute optional int16u averageRmsUnderVoltageCounterPhaseB = 2323; - readonly attribute optional int16u rmsExtremeOverVoltagePeriodPhaseB = 2324; - readonly attribute optional int16u rmsExtremeUnderVoltagePeriodPhaseB = 2325; - readonly attribute optional int16u rmsVoltageSagPeriodPhaseB = 2326; - readonly attribute optional int16u rmsVoltageSwellPeriodPhaseB = 2327; - readonly attribute optional int16u lineCurrentPhaseC = 2561; - readonly attribute optional int16s activeCurrentPhaseC = 2562; - readonly attribute optional int16s reactiveCurrentPhaseC = 2563; - readonly attribute optional int16u rmsVoltagePhaseC = 2565; - readonly attribute optional int16u rmsVoltageMinPhaseC = 2566; - readonly attribute optional int16u rmsVoltageMaxPhaseC = 2567; - readonly attribute optional int16u rmsCurrentPhaseC = 2568; - readonly attribute optional int16u rmsCurrentMinPhaseC = 2569; - readonly attribute optional int16u rmsCurrentMaxPhaseC = 2570; - readonly attribute optional int16s activePowerPhaseC = 2571; - readonly attribute optional int16s activePowerMinPhaseC = 2572; - readonly attribute optional int16s activePowerMaxPhaseC = 2573; - readonly attribute optional int16s reactivePowerPhaseC = 2574; - readonly attribute optional int16u apparentPowerPhaseC = 2575; - readonly attribute optional int8s powerFactorPhaseC = 2576; - readonly attribute optional int16u averageRmsVoltageMeasurementPeriodPhaseC = 2577; - readonly attribute optional int16u averageRmsOverVoltageCounterPhaseC = 2578; - readonly attribute optional int16u averageRmsUnderVoltageCounterPhaseC = 2579; - readonly attribute optional int16u rmsExtremeOverVoltagePeriodPhaseC = 2580; - readonly attribute optional int16u rmsExtremeUnderVoltagePeriodPhaseC = 2581; - readonly attribute optional int16u rmsVoltageSagPeriodPhaseC = 2582; - readonly attribute optional int16u rmsVoltageSwellPeriodPhaseC = 2583; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - response struct GetProfileInfoResponseCommand = 0 { - int8u profileCount = 0; - enum8 profileIntervalPeriod = 1; - int8u maxNumberOfIntervals = 2; - int16u listOfAttributes[] = 3; - } - - response struct GetMeasurementProfileResponseCommand = 1 { - int32u startTime = 0; - enum8 status = 1; - enum8 profileIntervalPeriod = 2; - int8u numberOfIntervalsDelivered = 3; - int16u attributeId = 4; - int8u intervals[] = 5; - } - - request struct GetMeasurementProfileCommandRequest { - int16u attributeId = 0; - int32u startTime = 1; - enum8 numberOfIntervals = 2; - } - - /** A function which retrieves the power profiling information from the electrical measurement server. */ - command GetProfileInfoCommand(): DefaultSuccess = 0; - /** A function which retrieves an electricity measurement profile from the electricity measurement server for a specific attribute Id requested. */ - command GetMeasurementProfileCommand(GetMeasurementProfileCommandRequest): DefaultSuccess = 1; -} - /** The Test Cluster is meant to validate the generated code */ internal cluster UnitTesting = 4294048773 { revision 1; // NOTE: Default/not specifically set @@ -8355,13 +8111,6 @@ endpoint 1 { handle command OnWithTimedOff; } - server cluster OnOffSwitchConfiguration { - ram attribute switchType; - ram attribute switchActions default = 0x00; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster LevelControl { persist attribute currentLevel default = 0xFE; ram attribute remainingTime default = 0x0000; @@ -8390,14 +8139,6 @@ endpoint 1 { handle command StopWithOnOff; } - server cluster BinaryInputBasic { - ram attribute outOfService default = 0x00; - ram attribute presentValue; - ram attribute statusFlags default = 0x00; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; @@ -9108,18 +8849,6 @@ endpoint 1 { handle command GoToTiltPercentage; } - server cluster BarrierControl { - ram attribute barrierMovingState; - ram attribute barrierSafetyStatus; - ram attribute barrierCapabilities; - ram attribute barrierPosition; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - - handle command BarrierControlGoToPercent; - handle command BarrierControlStop; - } - server cluster PumpConfigurationAndControl { ram attribute maxPressure; ram attribute maxSpeed; @@ -9573,22 +9302,6 @@ endpoint 1 { handle command Sleep; } - server cluster ElectricalMeasurement { - ram attribute measurementType default = 0x000000; - ram attribute totalActivePower default = 0x000000; - ram attribute rmsVoltage default = 0xffff; - ram attribute rmsVoltageMin default = 0x8000; - ram attribute rmsVoltageMax default = 0x8000; - ram attribute rmsCurrent default = 0xffff; - ram attribute rmsCurrentMin default = 0xffff; - ram attribute rmsCurrentMax default = 0xffff; - ram attribute activePower default = 0xffff; - ram attribute activePowerMin default = 0xffff; - ram attribute activePowerMax default = 0xffff; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 3; - } - server cluster UnitTesting { emits event TestEvent; emits event TestFabricScopedEvent; 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 94747c1fbf40c8..f8e3dbd8806c3f 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 @@ -1176,24 +1176,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -6540,40 +6522,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -6812,81 +6760,6 @@ } ] }, - { - "name": "On/off Switch Configuration", - "code": 7, - "mfgCode": null, - "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "apiMaturity": "deprecated", - "attributes": [ - { - "name": "switch type", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "switch actions", - "code": 16, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Level Control", "code": 8, @@ -7219,97 +7092,6 @@ } ] }, - { - "name": "Binary Input (Basic)", - "code": 15, - "mfgCode": null, - "define": "BINARY_INPUT_BASIC_CLUSTER", - "side": "server", - "enabled": 1, - "apiMaturity": "deprecated", - "attributes": [ - { - "name": "out of service", - "code": 81, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "present value", - "code": 85, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "status flags", - "code": 111, - "mfgCode": null, - "side": "server", - "type": "bitmap8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, @@ -15751,131 +15533,6 @@ } ] }, - { - "name": "Barrier Control", - "code": 259, - "mfgCode": null, - "define": "BARRIER_CONTROL_CLUSTER", - "side": "server", - "enabled": 1, - "apiMaturity": "deprecated", - "commands": [ - { - "name": "BarrierControlGoToPercent", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "BarrierControlStop", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "barrier moving state", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "barrier safety status", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "bitmap16", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "barrier capabilities", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "bitmap8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "barrier position", - "code": 10, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Pump Configuration and Control", "code": 512, @@ -21949,225 +21606,6 @@ } ] }, - { - "name": "Electrical Measurement", - "code": 2820, - "mfgCode": null, - "define": "ELECTRICAL_MEASUREMENT_CLUSTER", - "side": "server", - "enabled": 1, - "apiMaturity": "deprecated", - "attributes": [ - { - "name": "measurement type", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "total active power", - "code": 772, - "mfgCode": null, - "side": "server", - "type": "int32s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rms voltage", - "code": 1285, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rms voltage min", - "code": 1286, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x8000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rms voltage max", - "code": 1287, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x8000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rms current", - "code": 1288, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rms current min", - "code": 1289, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rms current max", - "code": 1290, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "active power", - "code": 1291, - "mfgCode": null, - "side": "server", - "type": "int16s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "active power min", - "code": 1292, - "mfgCode": null, - "side": "server", - "type": "int16s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "active power max", - "code": 1293, - "mfgCode": null, - "side": "server", - "type": "int16s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Unit Testing", "code": 4294048773, diff --git a/examples/all-clusters-app/esp32/main/CMakeLists.txt b/examples/all-clusters-app/esp32/main/CMakeLists.txt index 66448c121f22db..31292543ca5f50 100644 --- a/examples/all-clusters-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-app/esp32/main/CMakeLists.txt @@ -60,7 +60,6 @@ set(SRC_DIRS_LIST "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/level-control" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/identify-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/access-control-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/barrier-control-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/window-covering-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" diff --git a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap index 249b28707df21b..82b1b2440303b7 100644 --- a/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap +++ b/examples/all-clusters-minimal-app/all-clusters-common/all-clusters-minimal-app.zap @@ -1027,24 +1027,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt b/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt index 06916c32c6670d..f82f301e3ae362 100644 --- a/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt +++ b/examples/all-clusters-minimal-app/esp32/main/CMakeLists.txt @@ -1,128 +1,127 @@ # -# Copyright (c) 2021 Project CHIP Authors -# All rights reserved. +# 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 +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) # The list of src and include dirs must be in sync with that in all-clusters-minimal-app/esp32/main/component.mk set(PRIV_INCLUDE_DIRS_LIST - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/include" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/common/include" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/device-energy-management/include" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-evse/include" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-reporting/include" - "${CMAKE_CURRENT_LIST_DIR}/include" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/common/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/device-energy-management/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-evse/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-reporting/include" + "${CMAKE_CURRENT_LIST_DIR}/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32" ) set(SRC_DIRS_LIST - "${CMAKE_CURRENT_LIST_DIR}" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/icd" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/reporting" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/administrator-commissioning-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/application-basic-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/test-cluster-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fan-control-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fixed-label-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/user-label-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/level-control" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/identify-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/access-control-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/account-login-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/application-launcher-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/audio-output-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/barrier-control-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/window-covering-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/groups-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/color-control-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/content-launch-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/media-input-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/mode-select-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/low-power-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/keypad-input-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/media-playback-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/target-navigator-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/temperature-control-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thermostat-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thermostat-user-interface-configuration-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/channel-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/scenes-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/smoke-co-alarm-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/switch-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/basic-information" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/door-lock-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/occupancy-sensor-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/device-energy-management-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/energy-evse-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/localization-configuration-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-format-localization-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wake-on-lan-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/pump-configuration-and-control-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/resource-monitoring-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/src" + "${CMAKE_CURRENT_LIST_DIR}" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/icd" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/reporting" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/administrator-commissioning-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/application-basic-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/test-cluster-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fan-control-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fixed-label-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/user-label-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/on-off-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/level-control" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/identify-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/access-control-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/account-login-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/application-launcher-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/audio-output-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/window-covering-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/groups-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/color-control-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/content-launch-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/media-input-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/mode-select-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/low-power-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/keypad-input-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/media-playback-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/target-navigator-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/temperature-control-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thermostat-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thermostat-user-interface-configuration-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/channel-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/scenes-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/smoke-co-alarm-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/switch-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/basic-information" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/door-lock-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/occupancy-sensor-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/device-energy-management-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/energy-evse-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/localization-configuration-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-format-localization-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wake-on-lan-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/pump-configuration-and-control-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/resource-monitoring-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/all-clusters-app/all-clusters-common/src" ) -if (CONFIG_ENABLE_PW_RPC) -# Append additional directories for RPC build -set(PRIV_INCLUDE_DIRS_LIST "${PRIV_INCLUDE_DIRS_LIST}" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/pw_sys_io/public" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed/esp32" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/lib/support" -) +if(CONFIG_ENABLE_PW_RPC) + # Append additional directories for RPC build + set(PRIV_INCLUDE_DIRS_LIST "${PRIV_INCLUDE_DIRS_LIST}" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/pw_sys_io/public" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed/esp32" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/lib/support" + ) -if (${IDF_VERSION_MAJOR} LESS 5) + if(${IDF_VERSION_MAJOR} LESS 5) list(APPEND PRIV_INCLUDE_DIRS_LIST "${IDF_PATH}/components/freertos/include/freertos") -else() + else() list(APPEND PRIV_INCLUDE_DIRS_LIST "${IDF_PATH}/components/freertos/FreeRTOS-Kernel/include/freertos") -endif() + endif() -set(SRC_DIRS_LIST "${SRC_DIRS_LIST}" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed/esp32" -) -endif (CONFIG_ENABLE_PW_RPC) + set(SRC_DIRS_LIST "${SRC_DIRS_LIST}" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed/esp32" + ) +endif(CONFIG_ENABLE_PW_RPC) idf_component_register(PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST} - SRC_DIRS ${SRC_DIRS_LIST}) + SRC_DIRS ${SRC_DIRS_LIST}) get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH) @@ -134,134 +133,132 @@ chip_app_component_zapgen("${CHIP_ROOT}/examples/all-clusters-minimal-app/all-cl set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") target_compile_options(${COMPONENT_LIB} PUBLIC - "-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=" + "-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=" ) -if (CONFIG_ENABLE_PW_RPC) +if(CONFIG_ENABLE_PW_RPC) + set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo") + include(${PIGWEED_ROOT}/pw_build/pigweed.cmake) + include(${PIGWEED_ROOT}/pw_protobuf_compiler/proto.cmake) + set(dir_pw_third_party_nanopb "${CHIP_ROOT}/third_party/nanopb/repo" CACHE STRING "" FORCE) -set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo") -include(${PIGWEED_ROOT}/pw_build/pigweed.cmake) -include(${PIGWEED_ROOT}/pw_protobuf_compiler/proto.cmake) -set(dir_pw_third_party_nanopb "${CHIP_ROOT}/third_party/nanopb/repo" CACHE STRING "" FORCE) - -pw_proto_library(attributes_service - SOURCES + pw_proto_library(attributes_service + SOURCES ${CHIP_ROOT}/examples/common/pigweed/protos/attributes_service.proto - INPUTS + INPUTS ${CHIP_ROOT}/examples/common/pigweed/protos/attributes_service.options - PREFIX + PREFIX attributes_service - STRIP_PREFIX + STRIP_PREFIX ${CHIP_ROOT}/examples/common/pigweed/protos - DEPS + DEPS pw_protobuf.common_proto -) + ) -pw_proto_library(button_service - SOURCES + pw_proto_library(button_service + SOURCES ${CHIP_ROOT}/examples/common/pigweed/protos/button_service.proto - PREFIX + PREFIX button_service - STRIP_PREFIX + STRIP_PREFIX ${CHIP_ROOT}/examples/common/pigweed/protos - DEPS + DEPS pw_protobuf.common_proto -) + ) -pw_proto_library(descriptor_service - SOURCES + pw_proto_library(descriptor_service + SOURCES ${CHIP_ROOT}/examples/common/pigweed/protos/descriptor_service.proto - PREFIX + PREFIX descriptor_service - STRIP_PREFIX + STRIP_PREFIX ${CHIP_ROOT}/examples/common/pigweed/protos - DEPS + DEPS pw_protobuf.common_proto -) + ) -pw_proto_library(device_service - SOURCES + pw_proto_library(device_service + SOURCES ${CHIP_ROOT}/examples/common/pigweed/protos/device_service.proto - INPUTS + INPUTS ${CHIP_ROOT}/examples/common/pigweed/protos/device_service.options - PREFIX + PREFIX device_service - STRIP_PREFIX + STRIP_PREFIX ${CHIP_ROOT}/examples/common/pigweed/protos - DEPS + DEPS pw_protobuf.common_proto -) + ) -pw_proto_library(lighting_service - SOURCES + pw_proto_library(lighting_service + SOURCES ${CHIP_ROOT}/examples/common/pigweed/protos/lighting_service.proto - PREFIX + PREFIX lighting_service - STRIP_PREFIX + STRIP_PREFIX ${CHIP_ROOT}/examples/common/pigweed/protos - DEPS + DEPS pw_protobuf.common_proto -) + ) -pw_proto_library(locking_service - SOURCES + pw_proto_library(locking_service + SOURCES ${CHIP_ROOT}/examples/common/pigweed/protos/locking_service.proto - PREFIX + PREFIX locking_service - STRIP_PREFIX + STRIP_PREFIX ${CHIP_ROOT}/examples/common/pigweed/protos - DEPS + DEPS pw_protobuf.common_proto -) + ) -pw_proto_library(wifi_service - SOURCES + pw_proto_library(wifi_service + SOURCES ${CHIP_ROOT}/examples/common/pigweed/protos/wifi_service.proto - INPUTS + INPUTS ${CHIP_ROOT}/examples/common/pigweed/protos/wifi_service.options - PREFIX + PREFIX wifi_service - DEPS + DEPS pw_protobuf.common_proto - STRIP_PREFIX + STRIP_PREFIX ${CHIP_ROOT}/examples/common/pigweed/protos -) + ) -target_link_libraries(${COMPONENT_LIB} PUBLIC - attributes_service.nanopb_rpc - button_service.nanopb_rpc - descriptor_service.nanopb_rpc - device_service.nanopb_rpc - lighting_service.nanopb_rpc - locking_service.nanopb_rpc - wifi_service.nanopb_rpc - pw_checksum - pw_hdlc - pw_log - pw_rpc.server - pw_sys_io - pw_trace - pw_trace_tokenized - pw_trace_tokenized.trace_buffer - pw_trace_tokenized.rpc_service - pw_trace_tokenized.protos.nanopb_rpc -) + target_link_libraries(${COMPONENT_LIB} PUBLIC + attributes_service.nanopb_rpc + button_service.nanopb_rpc + descriptor_service.nanopb_rpc + device_service.nanopb_rpc + lighting_service.nanopb_rpc + locking_service.nanopb_rpc + wifi_service.nanopb_rpc + pw_checksum + pw_hdlc + pw_log + pw_rpc.server + pw_sys_io + pw_trace + pw_trace_tokenized + pw_trace_tokenized.trace_buffer + pw_trace_tokenized.rpc_service + pw_trace_tokenized.protos.nanopb_rpc + ) -target_link_options(${COMPONENT_LIB} - PUBLIC + target_link_options(${COMPONENT_LIB} + PUBLIC "-T${PIGWEED_ROOT}/pw_tokenizer/pw_tokenizer_linker_sections.ld" "-L${PIGWEED_ROOT}/pw_tokenizer" -) - -target_compile_options(${COMPONENT_LIB} PRIVATE - "-DPW_RPC_ATTRIBUTE_SERVICE=1" - "-DPW_RPC_BUTTON_SERVICE=1" - "-DPW_RPC_DESCRIPTOR_SERVICE=1" - "-DPW_RPC_DEVICE_SERVICE=1" - "-DPW_RPC_LIGHTING_SERVICE=1" - "-DPW_RPC_LOCKING_SERVICE=1" - "-DPW_RPC_TRACING_SERVICE=1" - "-DPW_RPC_WIFI_SERVICE=1" - "-DPW_TRACE_BACKEND_SET=1") + ) -endif (CONFIG_ENABLE_PW_RPC) + target_compile_options(${COMPONENT_LIB} PRIVATE + "-DPW_RPC_ATTRIBUTE_SERVICE=1" + "-DPW_RPC_BUTTON_SERVICE=1" + "-DPW_RPC_DESCRIPTOR_SERVICE=1" + "-DPW_RPC_DEVICE_SERVICE=1" + "-DPW_RPC_LIGHTING_SERVICE=1" + "-DPW_RPC_LOCKING_SERVICE=1" + "-DPW_RPC_TRACING_SERVICE=1" + "-DPW_RPC_WIFI_SERVICE=1" + "-DPW_TRACE_BACKEND_SET=1") +endif(CONFIG_ENABLE_PW_RPC) diff --git a/examples/bridge-app/bridge-common/bridge-app.zap b/examples/bridge-app/bridge-common/bridge-app.zap index 1b6b16be94d51a..5b820fd57c83cc 100644 --- a/examples/bridge-app/bridge-common/bridge-app.zap +++ b/examples/bridge-app/bridge-common/bridge-app.zap @@ -221,41 +221,7 @@ "mfgCode": null, "define": "ACCESS_CONTROL_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Access Control", @@ -4757,41 +4723,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Actions", diff --git a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap index 1636d8aab6b119..5f2e2bd0eb4859 100644 --- a/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/noip_rootnode_dimmablelight_bCwGYSDpoe.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -4568,41 +4550,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Occupancy Sensing", @@ -4610,41 +4558,7 @@ "mfgCode": null, "define": "OCCUPANCY_SENSING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 } ] } diff --git a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.zap b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.zap index 78aa987f1d8fa6..da6333deeef08f 100644 --- a/examples/chef/devices/rootnode_airpurifier_73a6fe2651.zap +++ b/examples/chef/devices/rootnode_airpurifier_73a6fe2651.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap index 7154d9edf4c91f..7e58d312609fc7 100644 --- a/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap +++ b/examples/chef/devices/rootnode_airqualitysensor_e63187f6c9.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap index 43d2e0e15b5146..0bb3ed63d078d9 100644 --- a/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap +++ b/examples/chef/devices/rootnode_basicvideoplayer_0ff86e943b.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap index 6aa6a2502fb4b4..24f3246bce52e8 100644 --- a/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap +++ b/examples/chef/devices/rootnode_colortemperaturelight_hbUnzYVeyn.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap index 2c65da229ebbe4..76b4309c6cf250 100644 --- a/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap +++ b/examples/chef/devices/rootnode_contactsensor_27f76aeaf5.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap index 78408b145c9317..5b66f7b9718212 100644 --- a/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap +++ b/examples/chef/devices/rootnode_contactsensor_lFAGG1bfRO.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -2825,41 +2807,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Power Source", diff --git a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap index fc6b2773a67e86..0651533b3cdb2f 100644 --- a/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap +++ b/examples/chef/devices/rootnode_dimmablelight_bCwGYSDpoe.zap @@ -802,24 +802,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3305,41 +3287,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Occupancy Sensing", @@ -3347,41 +3295,7 @@ "mfgCode": null, "define": "OCCUPANCY_SENSING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 } ] } diff --git a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap index 09dfe991518468..fc429171835ec5 100644 --- a/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap +++ b/examples/chef/devices/rootnode_dimmablepluginunit_f8a9a0b9d4.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3385,41 +3367,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Scenes Management", @@ -3672,41 +3620,7 @@ "mfgCode": null, "define": "OCCUPANCY_SENSING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 } ] } diff --git a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap index a08fcd9f2f02b7..85fd040970f9c1 100644 --- a/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap +++ b/examples/chef/devices/rootnode_doorlock_aNKYAreMXE.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap index 5cfcfdfa3a27a8..a4f09cc013f125 100644 --- a/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap +++ b/examples/chef/devices/rootnode_extendedcolorlight_8lcaaYJVAa.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3273,25 +3255,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Color Control", diff --git a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap index 2ee1ba966b139a..1f976f24c67632 100644 --- a/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap +++ b/examples/chef/devices/rootnode_fan_7N2TobIlOX.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap index 3974dabbc27d78..b1a23b03ad6d3d 100644 --- a/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap +++ b/examples/chef/devices/rootnode_flowsensor_1zVxHedlaV.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -2467,41 +2449,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Descriptor", @@ -2663,41 +2611,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Flow Measurement", diff --git a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap index 483f04f74af7e0..912729e0646dc2 100644 --- a/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap +++ b/examples/chef/devices/rootnode_heatingcoolingunit_ncdGai1E5a.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3177,41 +3159,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Thermostat", @@ -3219,41 +3167,7 @@ "mfgCode": null, "define": "THERMOSTAT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Fan Control", diff --git a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap index 11d5fb7f1dee99..f62c601c05aecf 100644 --- a/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap +++ b/examples/chef/devices/rootnode_humiditysensor_Xyj4gda6Hb.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -2467,41 +2449,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Descriptor", @@ -2663,41 +2611,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Relative Humidity Measurement", diff --git a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap index 459c52fe5a2570..833cca12b97c4b 100644 --- a/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap +++ b/examples/chef/devices/rootnode_lightsensor_lZQycTFcJK.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -2467,25 +2449,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Descriptor", @@ -2647,25 +2611,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Illuminance Measurement", diff --git a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap index e6b4dcef3ed3ae..05d6200c7917d0 100644 --- a/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap +++ b/examples/chef/devices/rootnode_occupancysensor_iHyVgifZuo.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -2467,41 +2449,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Descriptor", @@ -2663,41 +2611,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Occupancy Sensing", diff --git a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap index 53e30c1ed298cd..d696db7a086855 100644 --- a/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap +++ b/examples/chef/devices/rootnode_onofflight_bbs1b7IaOV.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3273,25 +3255,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 } ] } diff --git a/examples/chef/devices/rootnode_onofflight_samplemei.zap b/examples/chef/devices/rootnode_onofflight_samplemei.zap index 30dca3d1e54ebf..480eb4a073f849 100644 --- a/examples/chef/devices/rootnode_onofflight_samplemei.zap +++ b/examples/chef/devices/rootnode_onofflight_samplemei.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3273,25 +3255,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Sample MEI", diff --git a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap index de332faefc57ea..a4823ec9c13bd7 100644 --- a/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap +++ b/examples/chef/devices/rootnode_onofflightswitch_FsPlMr090Q.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -2681,24 +2663,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -2861,25 +2825,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 } ] } diff --git a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap index 99f826d194b05a..4242c860e86e00 100644 --- a/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap +++ b/examples/chef/devices/rootnode_onoffpluginunit_Wtf8ss5EBY.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3005,41 +2987,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 } ] } diff --git a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap index 21c60d8cef2350..3131dca9c5d00d 100644 --- a/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap +++ b/examples/chef/devices/rootnode_pressuresensor_s0qC9wLH4k.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -2525,25 +2507,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Descriptor", @@ -2705,25 +2669,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Pressure Measurement", diff --git a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap index 61325839e9d157..509ebc9db82193 100644 --- a/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap +++ b/examples/chef/devices/rootnode_speaker_RpzeXdimqA.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -2989,41 +2971,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 } ] } diff --git a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap index 2c20622caa4824..0395fbd3633f57 100644 --- a/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap +++ b/examples/chef/devices/rootnode_temperaturesensor_Qy1zkNW7c3.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -2467,41 +2449,7 @@ "mfgCode": null, "define": "GROUPS_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Descriptor", @@ -2663,41 +2611,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Temperature Measurement", diff --git a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap index c30fe33f9e465c..f1a0ae9c7c03ed 100644 --- a/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap +++ b/examples/chef/devices/rootnode_thermostat_bm3fb8dhYi.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -2973,41 +2955,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Thermostat", @@ -3547,41 +3495,7 @@ "mfgCode": null, "define": "FAN_CONTROL_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "f", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Thermostat User Interface Configuration", @@ -3711,41 +3625,7 @@ "mfgCode": null, "define": "TEMPERATURE_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Relative Humidity Measurement", @@ -3753,41 +3633,7 @@ "mfgCode": null, "define": "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Occupancy Sensing", @@ -3795,41 +3641,7 @@ "mfgCode": null, "define": "OCCUPANCY_SENSING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 } ] } diff --git a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap index 043e0a30a7c335..930d7bfc1b1e0b 100644 --- a/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap +++ b/examples/chef/devices/rootnode_windowcovering_RLCxaGi9Yx.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x0001", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -2809,25 +2791,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Window Covering", diff --git a/examples/chef/sample_app_util/zap_file_parser.py b/examples/chef/sample_app_util/zap_file_parser.py index 99881ba57c4d76..0176b1f1f39d5b 100644 --- a/examples/chef/sample_app_util/zap_file_parser.py +++ b/examples/chef/sample_app_util/zap_file_parser.py @@ -145,8 +145,8 @@ def _convert_metadata_to_hashable_digest(metadata_input: Sequence[Dict[str, Endp cluster_obj = endpoint_obj[cluster_type][cluster_id] # Replace attribute names - attribute_obj = cluster_obj["attributes"] - attribute_keys = list(cluster_obj["attributes"]) + attribute_obj = cluster_obj.get("attributes", []) + attribute_keys = list(attribute_obj) for attribute_key in attribute_keys: attribute_id = _get_id(attribute_key) attribute_obj[attribute_id] = attribute_obj.pop( @@ -252,7 +252,8 @@ def generate_metadata( else: cluster_obj: ClusterType = {"attributes": {}} - for attribute in cluster["attributes"]: + attributes = cluster.get("attributes", []) + for attribute in attributes: attribute_allowed = ( attribute_allow_list is None or str(attribute["code"]) in attribute_allow_list) if attribute["included"] and attribute_allowed: @@ -311,7 +312,7 @@ def generate_name(zap_file_path: str) -> str: zap_file_path: Path to the zap file to parse for generating the metadata file. Returns: - Name of the file generated by following convention. + Name of the file generated by following the convention. """ parsed = generate_metadata(zap_file_path) names = [] diff --git a/examples/chip-tool/README.md b/examples/chip-tool/README.md index b22b5276c8c7b6..f702e202ac6e86 100644 --- a/examples/chip-tool/README.md +++ b/examples/chip-tool/README.md @@ -253,12 +253,10 @@ Usage: +-------------------------------------------------------------------------------------+ | Clusters: | +-------------------------------------------------------------------------------------+ - | * barriercontrol | | * basic | | * colorcontrol | | * doorlock | | * groups | - | * iaszone | | * identify | | * levelcontrol | | * onoff | @@ -344,12 +342,10 @@ chip-tool payload parse-additional-data-payload "#####" ## Command List -- [barriercontrol](#barriercontrol) - [basic](#basic) - [colorcontrol](#colorcontrol) - [doorlock](#doorlock) - [groups](#groups) -- [iaszone](#iaszone) - [identify](#identify) - [levelcontrol](#levelcontrol) - [onoff](#onoff) @@ -360,22 +356,6 @@ chip-tool payload parse-additional-data-payload "#####" ## Command Details -### barriercontrol - -```bash -Usage: - ./chip-tool barriercontrol command_name [param1 param2 ...] - - +-------------------------------------------------------------------------------------+ - | Commands: | - +-------------------------------------------------------------------------------------+ - | * barrier-control-go-to-percent | - | * barrier-control-stop | - | * discover | - | * read | - +-------------------------------------------------------------------------------------+ -``` - ### basic ```bash @@ -478,21 +458,6 @@ Usage: +-------------------------------------------------------------------------------------+ ``` -### iaszone - -```bash -Usage: - ./chip-tool iaszone command_name [param1 param2 ...] - - +-------------------------------------------------------------------------------------+ - | Commands: | - +-------------------------------------------------------------------------------------+ - | * discover | - | * read | - | * write | - +-------------------------------------------------------------------------------------+ -``` - ### identify ```bash diff --git a/examples/common/pigweed/protos/attributes_service.proto b/examples/common/pigweed/protos/attributes_service.proto index 0256e6e0434690..927f10a8aa2fc6 100644 --- a/examples/common/pigweed/protos/attributes_service.proto +++ b/examples/common/pigweed/protos/attributes_service.proto @@ -76,13 +76,10 @@ enum ClusterType { ZCL_DEVICE_TEMP_CLUSTER_ID = 0x0002; ZCL_IDENTIFY_CLUSTER_ID = 0x0003; ZCL_GROUPS_CLUSTER_ID = 0x0004; - ZCL_SCENES_CLUSTER_ID = 0x0005; ZCL_ON_OFF_CLUSTER_ID = 0x0006; - ZCL_ON_OFF_SWITCH_CONFIGURATION_CLUSTER_ID = 0x0007; ZCL_LEVEL_CONTROL_CLUSTER_ID = 0x0008; ZCL_ALARM_CLUSTER_ID = 0x0009; ZCL_TIME_CLUSTER_ID = 0x000A; - ZCL_BINARY_INPUT_BASIC_CLUSTER_ID = 0x000F; ZCL_POWER_PROFILE_CLUSTER_ID = 0x001A; ZCL_APPLIANCE_CONTROL_CLUSTER_ID = 0x001B; ZCL_DESCRIPTOR_CLUSTER_ID = 0x001D; @@ -126,7 +123,6 @@ enum ClusterType { ZCL_SHADE_CONFIG_CLUSTER_ID = 0x0100; ZCL_DOOR_LOCK_CLUSTER_ID = 0x0101; ZCL_WINDOW_COVERING_CLUSTER_ID = 0x0102; - ZCL_BARRIER_CONTROL_CLUSTER_ID = 0x0103; ZCL_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_ID = 0x0200; ZCL_THERMOSTAT_CLUSTER_ID = 0x0201; ZCL_FAN_CONTROL_CLUSTER_ID = 0x0202; @@ -176,8 +172,6 @@ enum ClusterType { ZCL_PM10_CONCENTRATION_MEASUREMENT_CLUSTER_ID = 0x042D; ZCL_TOTAL_VOLATILE_ORGANIC_COMPOUNDS_CONCENTRATION_MEASUREMENT_CLUSTER_ID = 0x042E; ZCL_RADON_CONCENTRATION_MEASUREMENT_CLUSTER_ID = 0x042F; - ZCL_IAS_ACE_CLUSTER_ID = 0x0501; - ZCL_IAS_WD_CLUSTER_ID = 0x0502; ZCL_WAKE_ON_LAN_CLUSTER_ID = 0x0503; ZCL_CHANNEL_CLUSTER_ID = 0x0504; ZCL_TARGET_NAVIGATOR_CLUSTER_ID = 0x0505; @@ -197,9 +191,6 @@ enum ClusterType { ZCL_METER_IDENTIFICATION_CLUSTER_ID = 0x0B01; ZCL_APPLIANCE_EVENTS_AND_ALERT_CLUSTER_ID = 0x0B02; ZCL_APPLIANCE_STATISTICS_CLUSTER_ID = 0x0B03; - ZCL_ELECTRICAL_MEASUREMENT_CLUSTER_ID = 0x0B04; - ZCL_BINDING_CLUSTER_ID = 0xF000; - ZCL_GROUP_KEY_MANAGEMENT_CLUSTER_ID = 0xF004; ZCL_SAMPLE_MFG_SPECIFIC_CLUSTER_ID = 0xFC00; // NOTE: This is a large number that becomes negative as a 32-bit integer. diff --git a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap index 2006f483e969f6..1aac3415237235 100644 --- a/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap +++ b/examples/contact-sensor-app/contact-sensor-common/contact-sensor-app.zap @@ -910,24 +910,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.zap b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.zap index 25d003c55eb798..31c3577edca1a3 100644 --- a/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.zap +++ b/examples/contact-sensor-app/nxp/zap-lit/contact-sensor-app.zap @@ -786,24 +786,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.zap b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.zap index ae00575abd3592..56717f4edfefcc 100644 --- a/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.zap +++ b/examples/contact-sensor-app/nxp/zap-sit/contact-sensor-app.zap @@ -786,24 +786,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/darwin-framework-tool/README.md b/examples/darwin-framework-tool/README.md index 4b8b2d29ac7658..2d7a11b47b874b 100644 --- a/examples/darwin-framework-tool/README.md +++ b/examples/darwin-framework-tool/README.md @@ -83,7 +83,6 @@ Usage: | * colorcontrol | | * doorlock | | * groups | - | * iaszone | | * identify | | * levelcontrol | | * onoff | diff --git a/examples/energy-management-app/esp32/main/CMakeLists.txt b/examples/energy-management-app/esp32/main/CMakeLists.txt index 56940fb5baa0a5..e5459616238d3d 100644 --- a/examples/energy-management-app/esp32/main/CMakeLists.txt +++ b/examples/energy-management-app/esp32/main/CMakeLists.txt @@ -1,112 +1,110 @@ # -# Copyright (c) 2021-2023 Project CHIP Authors -# All rights reserved. +# Copyright (c) 2021-2023 Project CHIP Authors +# All rights reserved. # -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at # -# http://www.apache.org/licenses/LICENSE-2.0 +# http://www.apache.org/licenses/LICENSE-2.0 # -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. # # (Uses default behaviour of compiling all source files in directory, adding 'include' to include path.) set(PRIV_INCLUDE_DIRS_LIST - "${APP_GEN_DIR}" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/common/include" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/device-energy-management/include" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-evse/include" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-reporting/include" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/water-heater/include" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/esp32/main/include" - "${CMAKE_CURRENT_LIST_DIR}/include" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32" + "${APP_GEN_DIR}" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/common/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/device-energy-management/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-evse/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-reporting/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/water-heater/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/esp32/main/include" + "${CMAKE_CURRENT_LIST_DIR}/include" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32" ) set(SRC_DIRS_LIST - "${CMAKE_CURRENT_LIST_DIR}" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/common/src" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/device-energy-management/src" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-evse/src" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-reporting/src" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/water-heater/src" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/time" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/reporting" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/access-control-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/administrator-commissioning-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/basic-information" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fixed-label-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/identify-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/localization-configuration-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-format-localization-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/barrier-control-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/energy-evse-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/device-energy-management-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-topology-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/switch-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/user-label-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/groups-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/mode-base-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/electrical-energy-measurement-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/electrical-power-measurement-server" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/water-heater-management-server" + "${CMAKE_CURRENT_LIST_DIR}" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/attributes" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/zzz_generated/app-common/app-common/zap-generated" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/providers" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/common/src" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/device-energy-management/src" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-evse/src" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/energy-reporting/src" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/energy-management-app/energy-management-common/water-heater/src" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/ota" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/common" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/time" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/shell_extension" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/util" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/reporting" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/access-control-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/administrator-commissioning-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/basic-information" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/bindings" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/descriptor" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/diagnostic-logs-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ethernet-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/fixed-label-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-commissioning-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/general-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/identify-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/localization-configuration-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/time-format-localization-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/energy-evse-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/device-energy-management-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/network-commissioning" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/operational-credentials-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-source-configuration-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/power-topology-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/software-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/switch-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/thread-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/user-label-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/wifi-network-diagnostics-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/ota-requestor" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/groups-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/group-key-mgmt-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/mode-base-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/electrical-energy-measurement-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/electrical-power-measurement-server" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/app/clusters/water-heater-management-server" ) - -if (CONFIG_ENABLE_PW_RPC) -# Append additional directories for RPC build -set(PRIV_INCLUDE_DIRS_LIST "${PRIV_INCLUDE_DIRS_LIST}" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/pw_sys_io/public" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed/esp32" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/lib/support" -) - -if (${IDF_VERSION_MAJOR} LESS 5) +if(CONFIG_ENABLE_PW_RPC) + # Append additional directories for RPC build + set(PRIV_INCLUDE_DIRS_LIST "${PRIV_INCLUDE_DIRS_LIST}" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32/pw_sys_io/public" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed/esp32" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/src/lib/support" + ) + + if(${IDF_VERSION_MAJOR} LESS 5) list(APPEND PRIV_INCLUDE_DIRS_LIST "${IDF_PATH}/components/freertos/include/freertos") -else() + else() list(APPEND PRIV_INCLUDE_DIRS_LIST "${IDF_PATH}/components/freertos/FreeRTOS-Kernel/include/freertos") -endif() + endif() -set(SRC_DIRS_LIST "${SRC_DIRS_LIST}" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed" - "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed/esp32" -) -endif (CONFIG_ENABLE_PW_RPC) + set(SRC_DIRS_LIST "${SRC_DIRS_LIST}" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/platform/esp32" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed" + "${CMAKE_SOURCE_DIR}/third_party/connectedhomeip/examples/common/pigweed/esp32" + ) +endif(CONFIG_ENABLE_PW_RPC) idf_component_register(PRIV_INCLUDE_DIRS ${PRIV_INCLUDE_DIRS_LIST} - SRC_DIRS ${SRC_DIRS_LIST}) + SRC_DIRS ${SRC_DIRS_LIST}) get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH) include("${CHIP_ROOT}/build/chip/esp32/esp32_codegen.cmake") @@ -114,143 +112,141 @@ include("${CHIP_ROOT}/build/chip/esp32/esp32_codegen.cmake") chip_app_component_codegen("${CHIP_ROOT}/examples/energy-management-app/energy-management-common/energy-management-app.matter") chip_app_component_zapgen("${CHIP_ROOT}/examples/energy-management-app/energy-management-common/energy-management-app.zap") -if (CONFIG_ENABLE_ESP_INSIGHTS_TRACE) - target_add_binary_data(${COMPONENT_TARGET} "insights_auth_key.txt" TEXT) +if(CONFIG_ENABLE_ESP_INSIGHTS_TRACE) + target_add_binary_data(${COMPONENT_TARGET} "insights_auth_key.txt" TEXT) endif() set_property(TARGET ${COMPONENT_LIB} PROPERTY CXX_STANDARD 17) target_compile_options(${COMPONENT_LIB} PRIVATE "-DCHIP_HAVE_CONFIG_H") target_compile_options(${COMPONENT_LIB} PUBLIC - "-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=" + "-DCHIP_ADDRESS_RESOLVE_IMPL_INCLUDE_HEADER=" ) -if (CONFIG_ENABLE_PW_RPC) +if(CONFIG_ENABLE_PW_RPC) + get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH) -get_filename_component(CHIP_ROOT ${CMAKE_SOURCE_DIR}/third_party/connectedhomeip REALPATH) - -set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo") -include(${PIGWEED_ROOT}/pw_build/pigweed.cmake) -include(${PIGWEED_ROOT}/pw_protobuf_compiler/proto.cmake) -set(dir_pw_third_party_nanopb "${CHIP_ROOT}/third_party/nanopb/repo" CACHE STRING "" FORCE) + set(PIGWEED_ROOT "${CHIP_ROOT}/third_party/pigweed/repo") + include(${PIGWEED_ROOT}/pw_build/pigweed.cmake) + include(${PIGWEED_ROOT}/pw_protobuf_compiler/proto.cmake) + set(dir_pw_third_party_nanopb "${CHIP_ROOT}/third_party/nanopb/repo" CACHE STRING "" FORCE) -pw_proto_library(attributes_service - SOURCES + pw_proto_library(attributes_service + SOURCES ${CHIP_ROOT}/examples/common/pigweed/protos/attributes_service.proto - INPUTS + INPUTS ${CHIP_ROOT}/examples/common/pigweed/protos/attributes_service.options - PREFIX + PREFIX attributes_service - STRIP_PREFIX + STRIP_PREFIX ${CHIP_ROOT}/examples/common/pigweed/protos - DEPS + DEPS pw_protobuf.common_proto -) + ) -pw_proto_library(button_service - SOURCES + pw_proto_library(button_service + SOURCES ${CHIP_ROOT}/examples/common/pigweed/protos/button_service.proto - PREFIX + PREFIX button_service - STRIP_PREFIX + STRIP_PREFIX ${CHIP_ROOT}/examples/common/pigweed/protos - DEPS + DEPS pw_protobuf.common_proto -) + ) -pw_proto_library(descriptor_service - SOURCES + pw_proto_library(descriptor_service + SOURCES ${CHIP_ROOT}/examples/common/pigweed/protos/descriptor_service.proto - PREFIX + PREFIX descriptor_service - STRIP_PREFIX + STRIP_PREFIX ${CHIP_ROOT}/examples/common/pigweed/protos - DEPS + DEPS pw_protobuf.common_proto -) + ) -pw_proto_library(device_service - SOURCES + pw_proto_library(device_service + SOURCES ${CHIP_ROOT}/examples/common/pigweed/protos/device_service.proto - INPUTS + INPUTS ${CHIP_ROOT}/examples/common/pigweed/protos/device_service.options - PREFIX + PREFIX device_service - STRIP_PREFIX + STRIP_PREFIX ${CHIP_ROOT}/examples/common/pigweed/protos - DEPS + DEPS pw_protobuf.common_proto -) + ) -pw_proto_library(lighting_service - SOURCES + pw_proto_library(lighting_service + SOURCES ${CHIP_ROOT}/examples/common/pigweed/protos/lighting_service.proto - PREFIX + PREFIX lighting_service - STRIP_PREFIX + STRIP_PREFIX ${CHIP_ROOT}/examples/common/pigweed/protos - DEPS + DEPS pw_protobuf.common_proto -) + ) -pw_proto_library(locking_service - SOURCES + pw_proto_library(locking_service + SOURCES ${CHIP_ROOT}/examples/common/pigweed/protos/locking_service.proto - PREFIX + PREFIX locking_service - STRIP_PREFIX + STRIP_PREFIX ${CHIP_ROOT}/examples/common/pigweed/protos - DEPS + DEPS pw_protobuf.common_proto -) + ) -pw_proto_library(wifi_service - SOURCES + pw_proto_library(wifi_service + SOURCES ${CHIP_ROOT}/examples/common/pigweed/protos/wifi_service.proto - INPUTS + INPUTS ${CHIP_ROOT}/examples/common/pigweed/protos/wifi_service.options - PREFIX + PREFIX wifi_service - DEPS + DEPS pw_protobuf.common_proto - STRIP_PREFIX + STRIP_PREFIX ${CHIP_ROOT}/examples/common/pigweed/protos -) - -target_link_libraries(${COMPONENT_LIB} PUBLIC - attributes_service.nanopb_rpc - button_service.nanopb_rpc - descriptor_service.nanopb_rpc - device_service.nanopb_rpc - lighting_service.nanopb_rpc - locking_service.nanopb_rpc - wifi_service.nanopb_rpc - pw_checksum - pw_hdlc - pw_log - pw_rpc.server - pw_sys_io - pw_trace - pw_trace_tokenized - pw_trace_tokenized.trace_buffer - pw_trace_tokenized.rpc_service - pw_trace_tokenized.protos.nanopb_rpc -) - -target_link_options(${COMPONENT_LIB} - PUBLIC + ) + + target_link_libraries(${COMPONENT_LIB} PUBLIC + attributes_service.nanopb_rpc + button_service.nanopb_rpc + descriptor_service.nanopb_rpc + device_service.nanopb_rpc + lighting_service.nanopb_rpc + locking_service.nanopb_rpc + wifi_service.nanopb_rpc + pw_checksum + pw_hdlc + pw_log + pw_rpc.server + pw_sys_io + pw_trace + pw_trace_tokenized + pw_trace_tokenized.trace_buffer + pw_trace_tokenized.rpc_service + pw_trace_tokenized.protos.nanopb_rpc + ) + + target_link_options(${COMPONENT_LIB} + PUBLIC "-T${PIGWEED_ROOT}/pw_tokenizer/pw_tokenizer_linker_sections.ld" "-L${PIGWEED_ROOT}/pw_tokenizer" -) - -target_compile_options(${COMPONENT_LIB} PRIVATE - "-DPW_RPC_ATTRIBUTE_SERVICE=1" - "-DPW_RPC_BUTTON_SERVICE=1" - "-DPW_RPC_DESCRIPTOR_SERVICE=1" - "-DPW_RPC_DEVICE_SERVICE=1" - "-DPW_RPC_LIGHTING_SERVICE=1" - "-DPW_RPC_LOCKING_SERVICE=1" - "-DPW_RPC_TRACING_SERVICE=1" - "-DPW_RPC_WIFI_SERVICE=1" - "-DPW_TRACE_BACKEND_SET=1") - -endif (CONFIG_ENABLE_PW_RPC) + ) + + target_compile_options(${COMPONENT_LIB} PRIVATE + "-DPW_RPC_ATTRIBUTE_SERVICE=1" + "-DPW_RPC_BUTTON_SERVICE=1" + "-DPW_RPC_DESCRIPTOR_SERVICE=1" + "-DPW_RPC_DEVICE_SERVICE=1" + "-DPW_RPC_LIGHTING_SERVICE=1" + "-DPW_RPC_LOCKING_SERVICE=1" + "-DPW_RPC_TRACING_SERVICE=1" + "-DPW_RPC_WIFI_SERVICE=1" + "-DPW_TRACE_BACKEND_SET=1") +endif(CONFIG_ENABLE_PW_RPC) diff --git a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.zap b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.zap index 6345745cde4fce..83dae81eec9a28 100644 --- a/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.zap +++ b/examples/fabric-bridge-app/fabric-bridge-common/fabric-bridge-app.zap @@ -221,41 +221,7 @@ "mfgCode": null, "define": "ACCESS_CONTROL_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Access Control", diff --git a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.zap b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.zap index 189241e5005e7a..8af4eaa8976040 100644 --- a/examples/laundry-washer-app/nxp/zap/laundry-washer-app.zap +++ b/examples/laundry-washer-app/nxp/zap/laundry-washer-app.zap @@ -850,24 +850,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp b/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp index 119fb710e5873e..b8a8019af39d8a 100644 --- a/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp +++ b/examples/light-switch-app/ameba/main/DeviceCallbacks.cpp @@ -113,10 +113,6 @@ void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Cluster { switch (clusterId) { - case OnOffSwitchConfiguration::Id: - OnOffSwitchConfigurationAttributeChangeCallback(endpointId, attributeId, type, value, size); - break; - case Identify::Id: OnIdentifyPostAttributeChangeCallback(endpointId, attributeId, value); break; @@ -157,13 +153,6 @@ void DeviceCallbacks::OnInternetConnectivityChange(const ChipDeviceEvent * event } } -void DeviceCallbacks::OnOffSwitchConfigurationAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, uint8_t type, - uint8_t * value, uint16_t size) -{ - ChipLogProgress(Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); -} - void IdentifyTimerHandler(Layer * systemLayer, void * appState, CHIP_ERROR error) { if (identifyTimerCount) diff --git a/examples/light-switch-app/ameba/main/include/DeviceCallbacks.h b/examples/light-switch-app/ameba/main/include/DeviceCallbacks.h index 745d1663f29a31..05b81d63bdae19 100644 --- a/examples/light-switch-app/ameba/main/include/DeviceCallbacks.h +++ b/examples/light-switch-app/ameba/main/include/DeviceCallbacks.h @@ -39,7 +39,5 @@ class DeviceCallbacks : public chip::DeviceManager::CHIPDeviceManagerCallbacks private: void OnInternetConnectivityChange(const chip::DeviceLayer::ChipDeviceEvent * event); - void OnOffSwitchConfigurationAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t type, - uint8_t * value, uint16_t size); void OnIdentifyPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); }; diff --git a/examples/light-switch-app/asr/src/DeviceCallbacks.cpp b/examples/light-switch-app/asr/src/DeviceCallbacks.cpp index 80d2893d09aa72..94bba13aec2470 100644 --- a/examples/light-switch-app/asr/src/DeviceCallbacks.cpp +++ b/examples/light-switch-app/asr/src/DeviceCallbacks.cpp @@ -98,13 +98,7 @@ void DeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Cluster { ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - if (clusterId == OnOffSwitchConfiguration::Id) - { - ChipLogProgress(Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - // WIP Apply attribute change to Light - } - else if (clusterId == Identify::Id) + if (clusterId == Identify::Id) { ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", ChipLogValueMEI(attributeId), type, *value, size); diff --git a/examples/light-switch-app/cc13x4_26x4/src/ZclCallbacks.cpp b/examples/light-switch-app/cc13x4_26x4/src/ZclCallbacks.cpp index 0ef772323fe39c..8e94642401e4e6 100644 --- a/examples/light-switch-app/cc13x4_26x4/src/ZclCallbacks.cpp +++ b/examples/light-switch-app/cc13x4_26x4/src/ZclCallbacks.cpp @@ -39,12 +39,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & (void) attributeId; ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - if (clusterId == OnOffSwitchConfiguration::Id) - { - ChipLogProgress(Zcl, "OnOffSwitchConfiguration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - } - else if (clusterId == Identify::Id) + if (clusterId == Identify::Id) { ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", ChipLogValueMEI(attributeId), type, *value, size); diff --git a/examples/light-switch-app/esp32/main/DeviceCallbacks.cpp b/examples/light-switch-app/esp32/main/DeviceCallbacks.cpp index 8fb0dabd95dec7..4bf90e1193f99f 100644 --- a/examples/light-switch-app/esp32/main/DeviceCallbacks.cpp +++ b/examples/light-switch-app/esp32/main/DeviceCallbacks.cpp @@ -42,9 +42,6 @@ void AppDeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Clus switch (clusterId) { - case OnOffSwitchConfiguration::Id: - OnOffSwitchConfigurationAttributeChangeCallback(endpointId, attributeId, type, value, size); - break; default: ESP_LOGI(TAG, "Unhandled cluster ID: %" PRIu32, clusterId); break; @@ -52,10 +49,3 @@ void AppDeviceCallbacks::PostAttributeChangeCallback(EndpointId endpointId, Clus ESP_LOGI(TAG, "Current free heap: %u\n", static_cast(heap_caps_get_free_size(MALLOC_CAP_8BIT))); } - -void AppDeviceCallbacks::OnOffSwitchConfigurationAttributeChangeCallback(EndpointId endpointId, AttributeId attributeId, - uint8_t type, uint8_t * value, uint16_t size) -{ - ChipLogProgress(Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); -} diff --git a/examples/light-switch-app/esp32/main/include/DeviceCallbacks.h b/examples/light-switch-app/esp32/main/include/DeviceCallbacks.h index 7d9c0b00b32861..7a0064c58a2821 100644 --- a/examples/light-switch-app/esp32/main/include/DeviceCallbacks.h +++ b/examples/light-switch-app/esp32/main/include/DeviceCallbacks.h @@ -37,8 +37,6 @@ class AppDeviceCallbacks : public CommonDeviceCallbacks private: void OnIdentifyPostAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t * value); - void OnOffSwitchConfigurationAttributeChangeCallback(chip::EndpointId endpointId, chip::AttributeId attributeId, uint8_t type, - uint8_t * value, uint16_t size); }; class AppDeviceCallbacksDelegate : public DeviceCallbacksDelegate diff --git a/examples/light-switch-app/genio/src/ZclCallbacks.cpp b/examples/light-switch-app/genio/src/ZclCallbacks.cpp index 52542ca88fb390..f89d4aaa8cd581 100644 --- a/examples/light-switch-app/genio/src/ZclCallbacks.cpp +++ b/examples/light-switch-app/genio/src/ZclCallbacks.cpp @@ -37,14 +37,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & AttributeId attributeId = attributePath.mAttributeId; ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - if (clusterId == OnOffSwitchConfiguration::Id) - { - ChipLogProgress(Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - - // WIP Apply attribute change to Light - } - else if (clusterId == Identify::Id) + if (clusterId == Identify::Id) { ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", ChipLogValueMEI(attributeId), type, *value, size); diff --git a/examples/light-switch-app/infineon/cyw30739/src/ZclCallbacks.cpp b/examples/light-switch-app/infineon/cyw30739/src/ZclCallbacks.cpp index a8e252719ae791..bf7e0e9b2b35a7 100644 --- a/examples/light-switch-app/infineon/cyw30739/src/ZclCallbacks.cpp +++ b/examples/light-switch-app/infineon/cyw30739/src/ZclCallbacks.cpp @@ -41,10 +41,6 @@ void MatterPostAttributeChangeCallback(const app::ConcreteAttributePath & attrib } } break; - case OnOffSwitchConfiguration::Id: - printf("OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u\n", - ChipLogValueMEI(attributePath.mAttributeId), type, *value, size); - return; default: printf("Unhandled cluster ID: 0x%04lx\n", attributePath.mClusterId); return; diff --git a/examples/light-switch-app/light-switch-common/light-switch-app.zap b/examples/light-switch-app/light-switch-common/light-switch-app.zap index e426e68bbc9063..89f718140f12e3 100644 --- a/examples/light-switch-app/light-switch-common/light-switch-app.zap +++ b/examples/light-switch-app/light-switch-common/light-switch-app.zap @@ -828,24 +828,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -4467,24 +4449,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -4767,24 +4731,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -5080,24 +5026,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -5236,24 +5164,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "7", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] } ] diff --git a/examples/light-switch-app/qpg/zap/switch.zap b/examples/light-switch-app/qpg/zap/switch.zap index 2b36781c42eb18..5e0a5474ab6e64 100644 --- a/examples/light-switch-app/qpg/zap/switch.zap +++ b/examples/light-switch-app/qpg/zap/switch.zap @@ -946,40 +946,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -5010,40 +4976,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -5422,40 +5354,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -5474,40 +5372,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -5915,24 +5779,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -5951,40 +5797,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "7", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] } ] diff --git a/examples/light-switch-app/silabs/src/ZclCallbacks.cpp b/examples/light-switch-app/silabs/src/ZclCallbacks.cpp index 13375537556067..790a39fa943e2d 100644 --- a/examples/light-switch-app/silabs/src/ZclCallbacks.cpp +++ b/examples/light-switch-app/silabs/src/ZclCallbacks.cpp @@ -37,14 +37,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & [[maybe_unused]] AttributeId attributeId = attributePath.mAttributeId; ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - if (clusterId == OnOffSwitchConfiguration::Id) - { - ChipLogProgress(Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - - // WIP Apply attribute change to Light - } - else if (clusterId == Identify::Id) + if (clusterId == Identify::Id) { ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", ChipLogValueMEI(attributeId), type, *value, size); diff --git a/examples/light-switch-app/telink/src/ZclCallbacks.cpp b/examples/light-switch-app/telink/src/ZclCallbacks.cpp index e7edb8514e7a18..a8fe88904d7f43 100644 --- a/examples/light-switch-app/telink/src/ZclCallbacks.cpp +++ b/examples/light-switch-app/telink/src/ZclCallbacks.cpp @@ -35,15 +35,7 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & AttributeId attributeId = attributePath.mAttributeId; ChipLogProgress(Zcl, "Cluster callback: " ChipLogFormatMEI, ChipLogValueMEI(clusterId)); - if (clusterId == OnOffSwitchConfiguration::Id) - { - // Following print is used for printing single-byte value. Change it for printing non-single-byte values. - ChipLogProgress(Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - - // WIP Apply attribute change to Light - } - else if (clusterId == Identify::Id) + if (clusterId == Identify::Id) { // Following print is used for printing single-byte value. Change it for printing non-single-byte values. ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", diff --git a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.zap b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.zap index 67cbfdedad076f..8d55481e31f739 100644 --- a/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.zap +++ b/examples/lighting-app-data-mode-no-unique-id/lighting-common/lighting-app.zap @@ -754,24 +754,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/lighting-app/bouffalolab/common/ZclCallbacks.cpp b/examples/lighting-app/bouffalolab/common/ZclCallbacks.cpp index e987fcbd325112..b546dd10d7c80b 100644 --- a/examples/lighting-app/bouffalolab/common/ZclCallbacks.cpp +++ b/examples/lighting-app/bouffalolab/common/ZclCallbacks.cpp @@ -56,12 +56,6 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & ChipLogProgress(Zcl, "Color Control attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", ChipLogValueMEI(attributeId), type, *value, size); } - else if (clusterId == OnOffSwitchConfiguration::Id) - { - GetAppTask().PostEvent(AppTask::APP_EVENT_LIGHTING_ONOFF); - ChipLogProgress(Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - } else if (clusterId == Identify::Id) { GetAppTask().PostEvent(AppTask::APP_EVENT_IDENTIFY_IDENTIFY); diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap index db1960f57718af..5a0e876845aef6 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-ethernet.zap @@ -664,24 +664,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap index 31f009e23fdb3a..0c3c28dbddfdd1 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-thread.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap index b5d0569687e8f6..3f7f9e31192dc2 100644 --- a/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap +++ b/examples/lighting-app/bouffalolab/data_model/lighting-app-wifi.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/lighting-app/genio/src/ZclCallbacks.cpp b/examples/lighting-app/genio/src/ZclCallbacks.cpp index 30faa57990ba7f..0af8c179e9599d 100644 --- a/examples/lighting-app/genio/src/ZclCallbacks.cpp +++ b/examples/lighting-app/genio/src/ZclCallbacks.cpp @@ -121,13 +121,6 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & LightMgr().InitiateAction(AppEvent::kEventType_Light, LightingManager::COLOR_ACTION_CT, (uint8_t *) &ct.ctMireds); } } - else if (clusterId == OnOffSwitchConfiguration::Id) - { - ChipLogProgress(Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - - // WIP Apply attribute change to Light - } else if (clusterId == Identify::Id) { ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", diff --git a/examples/lighting-app/infineon/psoc6/src/ZclCallbacks.cpp b/examples/lighting-app/infineon/psoc6/src/ZclCallbacks.cpp index d67c8cc86c6597..4ca91fd6c14c35 100644 --- a/examples/lighting-app/infineon/psoc6/src/ZclCallbacks.cpp +++ b/examples/lighting-app/infineon/psoc6/src/ZclCallbacks.cpp @@ -56,13 +56,6 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & // WIP Apply attribute change to Light } - else if (clusterId == OnOffSwitchConfiguration::Id) - { - ChipLogProgress(Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - - // WIP Apply attribute change to Light - } else if (clusterId == Identify::Id) { ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", diff --git a/examples/lighting-app/lighting-common/lighting-app.zap b/examples/lighting-app/lighting-common/lighting-app.zap index a11ef874882a93..b7928f3b96f163 100644 --- a/examples/lighting-app/lighting-common/lighting-app.zap +++ b/examples/lighting-app/lighting-common/lighting-app.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/lighting-app/nxp/common/DeviceCallbacks.cpp b/examples/lighting-app/nxp/common/DeviceCallbacks.cpp index 140cdffb9febe2..76ef5a383daca3 100644 --- a/examples/lighting-app/nxp/common/DeviceCallbacks.cpp +++ b/examples/lighting-app/nxp/common/DeviceCallbacks.cpp @@ -69,13 +69,6 @@ void LightingApp::DeviceCallbacks::PostAttributeChangeCallback(chip::EndpointId // WIP Apply attribute change to Light } - else if (clusterId == OnOffSwitchConfiguration::Id) - { - ChipLogProgress(Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - - // WIP Apply attribute change to Light - } else { ChipLogProgress(Zcl, "Unknown attribute ID: " ChipLogFormatMEI, ChipLogValueMEI(attributeId)); diff --git a/examples/lighting-app/nxp/k32w0/main/ZclCallbacks.cpp b/examples/lighting-app/nxp/k32w0/main/ZclCallbacks.cpp index caccdf51b0665b..3812761df25807 100644 --- a/examples/lighting-app/nxp/k32w0/main/ZclCallbacks.cpp +++ b/examples/lighting-app/nxp/k32w0/main/ZclCallbacks.cpp @@ -55,13 +55,6 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & // WIP Apply attribute change to Light } - else if (path.mClusterId == OnOffSwitchConfiguration::Id) - { - ChipLogProgress(Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(path.mAttributeId), type, *value, size); - - // WIP Apply attribute change to Light - } else { ChipLogProgress(Zcl, "Unknown attribute ID: " ChipLogFormatMEI, ChipLogValueMEI(path.mAttributeId)); diff --git a/examples/lighting-app/nxp/zap/lighting-on-off.zap b/examples/lighting-app/nxp/zap/lighting-on-off.zap index 941eb33fb2c5d2..6d5d8fd8cb382d 100644 --- a/examples/lighting-app/nxp/zap/lighting-on-off.zap +++ b/examples/lighting-app/nxp/zap/lighting-on-off.zap @@ -658,24 +658,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/lighting-app/qpg/zap/light.zap b/examples/lighting-app/qpg/zap/light.zap index d1d40286f88ac7..f4b4c6f1bf8ce9 100644 --- a/examples/lighting-app/qpg/zap/light.zap +++ b/examples/lighting-app/qpg/zap/light.zap @@ -898,40 +898,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap index 8ce49423a2afb1..2644717a84a11a 100644 --- a/examples/lighting-app/silabs/data_model/lighting-thread-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-thread-app.zap @@ -747,24 +747,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap index fe5189980b619e..086261b9e095dc 100644 --- a/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap +++ b/examples/lighting-app/silabs/data_model/lighting-wifi-app.zap @@ -747,24 +747,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/lighting-app/silabs/src/ZclCallbacks.cpp b/examples/lighting-app/silabs/src/ZclCallbacks.cpp index 1a27a20da15a63..3e56ac26e3b9c7 100644 --- a/examples/lighting-app/silabs/src/ZclCallbacks.cpp +++ b/examples/lighting-app/silabs/src/ZclCallbacks.cpp @@ -63,13 +63,6 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & // WIP Apply attribute change to Light } - else if (clusterId == OnOffSwitchConfiguration::Id) - { - ChipLogProgress(Zcl, "OnOff Switch Configuration attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", - ChipLogValueMEI(attributeId), type, *value, size); - - // WIP Apply attribute change to Light - } else if (clusterId == Identify::Id) { ChipLogProgress(Zcl, "Identify attribute ID: " ChipLogFormatMEI " Type: %u Value: %u, length %u", diff --git a/examples/lock-app/lock-common/lock-app.zap b/examples/lock-app/lock-common/lock-app.zap index de7a4801225d75..cd8979532f284e 100644 --- a/examples/lock-app/lock-common/lock-app.zap +++ b/examples/lock-app/lock-common/lock-app.zap @@ -954,24 +954,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/lock-app/qpg/zap/lock.zap b/examples/lock-app/qpg/zap/lock.zap index d46b1f63567e2f..f8a1eee9ae162d 100644 --- a/examples/lock-app/qpg/zap/lock.zap +++ b/examples/lock-app/qpg/zap/lock.zap @@ -898,40 +898,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/network-manager-app/network-manager-common/network-manager-app.matter b/examples/network-manager-app/network-manager-common/network-manager-app.matter index 0ed34e7eea61fb..1ed4ed6159a260 100644 --- a/examples/network-manager-app/network-manager-common/network-manager-app.matter +++ b/examples/network-manager-app/network-manager-common/network-manager-app.matter @@ -1724,8 +1724,6 @@ endpoint 0 { callback attribute attributeList; ram attribute featureMap default = 0; ram attribute clusterRevision default = 1; - - handle command ResetCounts; } server cluster AdministratorCommissioning { diff --git a/examples/network-manager-app/network-manager-common/network-manager-app.zap b/examples/network-manager-app/network-manager-common/network-manager-app.zap index a016ef57f5c9e9..35b4af63d808e2 100644 --- a/examples/network-manager-app/network-manager-common/network-manager-app.zap +++ b/examples/network-manager-app/network-manager-common/network-manager-app.zap @@ -347,7 +347,7 @@ "storageOption": "External", "singleton": 0, "bounded": 0, - "defaultValue": "", + "defaultValue": null, "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -449,16 +449,9 @@ "side": "server", "included": 1 }, - { - "name": "AccessRestrictionEntryChanged", - "code": 2, - "mfgCode": null, - "side": "server", - "included": 1 - }, { "name": "FabricRestrictionReviewUpdate", - "code": 3, + "code": 2, "mfgCode": null, "side": "server", "included": 1 @@ -2294,16 +2287,7 @@ "define": "ETHERNET_NETWORK_DIAGNOSTICS_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "ResetCounts", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 0 - } - ], + "commands": [], "attributes": [ { "name": "GeneratedCommandList", 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 e1cb30834e29ad..eb621485f6d0d4 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 @@ -221,25 +221,7 @@ "mfgCode": null, "define": "ACCESS_CONTROL_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Access Control", 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 c14a51d1a3d5e9..ab924da3dfabc7 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 @@ -954,40 +954,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { diff --git a/examples/placeholder/linux/apps/app1/config.zap b/examples/placeholder/linux/apps/app1/config.zap index 21f2a00eb50e9b..248e02c0537aa5 100644 --- a/examples/placeholder/linux/apps/app1/config.zap +++ b/examples/placeholder/linux/apps/app1/config.zap @@ -2005,40 +2005,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -2992,25 +2958,7 @@ "mfgCode": null, "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Thread Network Diagnostics", @@ -4862,41 +4810,7 @@ "mfgCode": null, "define": "SWITCH_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Switch", @@ -5288,40 +5202,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -5918,40 +5798,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -6318,24 +6164,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -7876,24 +7704,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -8712,41 +8522,7 @@ "mfgCode": null, "define": "THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Thermostat User Interface Configuration", @@ -9014,25 +8790,7 @@ "mfgCode": null, "define": "TEMPERATURE_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Temperature Measurement", @@ -9438,77 +9196,43 @@ "mfgCode": null, "define": "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER", "side": "client", + "enabled": 1 + }, + { + "name": "Relative Humidity Measurement", + "code": 1029, + "mfgCode": null, + "define": "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER", + "side": "server", "enabled": 1, "attributes": [ { - "name": "FeatureMap", - "code": 65532, + "name": "MeasuredValue", + "code": 0, "mfgCode": null, - "side": "client", - "type": "bitmap32", + "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "ClusterRevision", - "code": 65533, + "name": "MinMeasuredValue", + "code": 1, "mfgCode": null, - "side": "client", + "side": "server", "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Relative Humidity Measurement", - "code": 1029, - "mfgCode": null, - "define": "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "MeasuredValue", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "MinMeasuredValue", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -9634,25 +9358,7 @@ "mfgCode": null, "define": "CHANNEL_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Channel", @@ -9794,24 +9500,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -10040,24 +9728,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -10318,25 +9988,7 @@ "mfgCode": null, "define": "MEDIA_INPUT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Media Input", @@ -10436,25 +10088,7 @@ "mfgCode": null, "define": "LOW_POWER_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Keypad Input", @@ -10480,24 +10114,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -10614,24 +10230,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -10788,41 +10386,7 @@ "mfgCode": null, "define": "AUDIO_OUTPUT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Audio Output", @@ -10956,40 +10520,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -11072,25 +10602,7 @@ "mfgCode": null, "define": "APPLICATION_BASIC_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Application Basic", @@ -11316,25 +10828,7 @@ "mfgCode": null, "define": "ACCOUNT_LOGIN_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Account Login", @@ -11431,41 +10925,7 @@ "mfgCode": null, "define": "IDENTIFY_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Identify", @@ -11851,40 +11311,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -12179,40 +11605,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -13117,41 +12509,7 @@ "mfgCode": null, "define": "LOCALIZATION_CONFIGURATION_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Localization Configuration", @@ -13233,25 +12591,7 @@ "mfgCode": null, "define": "UNIT_LOCALIZATION_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Unit Localization", @@ -13317,25 +12657,7 @@ "mfgCode": null, "define": "FIXED_LABEL_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Fixed Label", @@ -13826,24 +13148,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "7", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { diff --git a/examples/placeholder/linux/apps/app2/config.zap b/examples/placeholder/linux/apps/app2/config.zap index 45b74c1f84c9bf..463c73a9c42371 100644 --- a/examples/placeholder/linux/apps/app2/config.zap +++ b/examples/placeholder/linux/apps/app2/config.zap @@ -2021,40 +2021,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -3008,25 +2974,7 @@ "mfgCode": null, "define": "THREAD_NETWORK_DIAGNOSTICS_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Thread Network Diagnostics", @@ -4878,41 +4826,7 @@ "mfgCode": null, "define": "SWITCH_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Switch", @@ -5304,40 +5218,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -5992,40 +5872,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -6392,24 +6238,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -7950,24 +7778,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -8786,41 +8596,7 @@ "mfgCode": null, "define": "THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Thermostat User Interface Configuration", @@ -9088,25 +8864,7 @@ "mfgCode": null, "define": "TEMPERATURE_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Temperature Measurement", @@ -9512,77 +9270,43 @@ "mfgCode": null, "define": "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER", "side": "client", + "enabled": 1 + }, + { + "name": "Relative Humidity Measurement", + "code": 1029, + "mfgCode": null, + "define": "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER", + "side": "server", "enabled": 1, "attributes": [ { - "name": "FeatureMap", - "code": 65532, + "name": "MeasuredValue", + "code": 0, "mfgCode": null, - "side": "client", - "type": "bitmap32", + "side": "server", + "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "0", + "defaultValue": "", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "ClusterRevision", - "code": 65533, + "name": "MinMeasuredValue", + "code": 1, "mfgCode": null, - "side": "client", + "side": "server", "type": "int16u", "included": 1, "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] - }, - { - "name": "Relative Humidity Measurement", - "code": 1029, - "mfgCode": null, - "define": "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER", - "side": "server", - "enabled": 1, - "attributes": [ - { - "name": "MeasuredValue", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "MinMeasuredValue", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -9708,25 +9432,7 @@ "mfgCode": null, "define": "CHANNEL_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Channel", @@ -9868,24 +9574,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -10114,24 +9802,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -10392,25 +10062,7 @@ "mfgCode": null, "define": "MEDIA_INPUT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Media Input", @@ -10510,25 +10162,7 @@ "mfgCode": null, "define": "LOW_POWER_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Keypad Input", @@ -10554,24 +10188,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -10696,24 +10312,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -10870,41 +10468,7 @@ "mfgCode": null, "define": "AUDIO_OUTPUT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Audio Output", @@ -11038,40 +10602,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -11154,25 +10684,7 @@ "mfgCode": null, "define": "APPLICATION_BASIC_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Application Basic", @@ -11398,25 +10910,7 @@ "mfgCode": null, "define": "ACCOUNT_LOGIN_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Account Login", @@ -11513,41 +11007,7 @@ "mfgCode": null, "define": "IDENTIFY_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Identify", @@ -11933,40 +11393,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -12261,40 +11687,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -13167,25 +12559,7 @@ "mfgCode": null, "define": "FIXED_LABEL_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Fixed Label", @@ -13586,24 +12960,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "7", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { diff --git a/examples/pump-app/pump-common/pump-app.zap b/examples/pump-app/pump-common/pump-app.zap index 0d3235ce637719..4e4fe6570db239 100644 --- a/examples/pump-app/pump-common/pump-app.zap +++ b/examples/pump-app/pump-common/pump-app.zap @@ -882,40 +882,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -4617,41 +4583,7 @@ "mfgCode": null, "define": "OCCUPANCY_SENSING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 } ] } diff --git a/examples/pump-app/silabs/data_model/pump-thread-app.zap b/examples/pump-app/silabs/data_model/pump-thread-app.zap index b58b4f50c804f5..e26ba1cc500af1 100644 --- a/examples/pump-app/silabs/data_model/pump-thread-app.zap +++ b/examples/pump-app/silabs/data_model/pump-thread-app.zap @@ -882,40 +882,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -4617,41 +4583,7 @@ "mfgCode": null, "define": "OCCUPANCY_SENSING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 } ] } diff --git a/examples/pump-app/silabs/data_model/pump-wifi-app.zap b/examples/pump-app/silabs/data_model/pump-wifi-app.zap index b58b4f50c804f5..e26ba1cc500af1 100644 --- a/examples/pump-app/silabs/data_model/pump-wifi-app.zap +++ b/examples/pump-app/silabs/data_model/pump-wifi-app.zap @@ -882,40 +882,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -4617,41 +4583,7 @@ "mfgCode": null, "define": "OCCUPANCY_SENSING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 } ] } 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 040218e9083e23..9ef65ceeacc485 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 @@ -882,40 +882,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -3015,40 +2981,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3317,41 +3249,7 @@ "mfgCode": null, "define": "PUMP_CONFIGURATION_AND_CONTROL_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Temperature Measurement", @@ -3359,41 +3257,7 @@ "mfgCode": null, "define": "TEMPERATURE_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Pressure Measurement", @@ -3401,41 +3265,7 @@ "mfgCode": null, "define": "PRESSURE_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Flow Measurement", @@ -3443,41 +3273,7 @@ "mfgCode": null, "define": "FLOW_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 } ] } diff --git a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap index 36f42d7a37f794..c6da2ccc572161 100644 --- a/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap +++ b/examples/smoke-co-alarm-app/smoke-co-alarm-common/smoke-co-alarm-app.zap @@ -731,24 +731,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap index b2a1e2c7bbb3ed..691a28bdc8c682 100644 --- a/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap +++ b/examples/temperature-measurement-app/temperature-measurement-common/temperature-measurement.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/thermostat/nxp/zap/thermostat_matter_thread.zap b/examples/thermostat/nxp/zap/thermostat_matter_thread.zap index 6b19e3da7c61fd..e873824f15e07c 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_thread.zap +++ b/examples/thermostat/nxp/zap/thermostat_matter_thread.zap @@ -850,24 +850,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3753,40 +3735,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap b/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap index e3868768ae56bc..f934eaeff7c62f 100644 --- a/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap +++ b/examples/thermostat/nxp/zap/thermostat_matter_wifi.zap @@ -850,24 +850,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -2847,40 +2829,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.zap b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.zap index 07d5830e2909bb..82b782ddead7c6 100644 --- a/examples/thermostat/qpg/zap/thermostaticRadiatorValve.zap +++ b/examples/thermostat/qpg/zap/thermostaticRadiatorValve.zap @@ -828,24 +828,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3553,24 +3535,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/thermostat/thermostat-common/thermostat.zap b/examples/thermostat/thermostat-common/thermostat.zap index bd5d8084997fe9..3f62022ea7f6fe 100644 --- a/examples/thermostat/thermostat-common/thermostat.zap +++ b/examples/thermostat/thermostat-common/thermostat.zap @@ -828,24 +828,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -4202,24 +4184,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/examples/tv-app/tv-common/tv-app.zap b/examples/tv-app/tv-common/tv-app.zap index 9acccceace7c4d..3ea4adf772089f 100644 --- a/examples/tv-app/tv-common/tv-app.zap +++ b/examples/tv-app/tv-common/tv-app.zap @@ -173,25 +173,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Binding", @@ -1168,24 +1150,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -1440,40 +1404,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3855,24 +3785,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -8948,40 +8860,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] } ] diff --git a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter index 3e4fe7fa47bc06..a28a236fa8ad5b 100644 --- a/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter +++ b/examples/tv-casting-app/tv-casting-common/tv-casting-app.matter @@ -558,27 +558,6 @@ cluster LevelControl = 8 { command MoveToClosestFrequency(MoveToClosestFrequencyRequest): DefaultSuccess = 8; } -/** An interface for reading the value of a binary measurement and accessing various characteristics of that measurement. */ -deprecated cluster BinaryInputBasic = 15 { - revision 1; // NOTE: Default/not specifically set - - attribute optional char_string<16> activeText = 4; - attribute optional char_string<16> description = 28; - attribute optional char_string<16> inactiveText = 46; - attribute boolean outOfService = 81; - readonly attribute optional enum8 polarity = 84; - attribute boolean presentValue = 85; - attribute optional enum8 reliability = 103; - readonly attribute bitmap8 statusFlags = 111; - readonly attribute optional int32u applicationType = 256; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; @@ -3220,14 +3199,6 @@ endpoint 1 { handle command AddGroupIfIdentifying; } - server cluster BinaryInputBasic { - ram attribute outOfService default = 0x00; - ram attribute presentValue; - ram attribute statusFlags default = 0x00; - ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; - } - server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; 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 a8cb35694cf8f7..6f4ab131fa0672 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 @@ -2991,40 +2991,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3099,131 +3065,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Binary Input (Basic)", - "code": 15, - "mfgCode": null, - "define": "BINARY_INPUT_BASIC_CLUSTER", - "side": "server", - "enabled": 1, - "apiMaturity": "deprecated", - "attributes": [ - { - "name": "out of service", - "code": 81, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "present value", - "code": 85, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "status flags", - "code": 111, - "mfgCode": null, - "side": "server", - "type": "bitmap8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3232,41 +3073,7 @@ "mfgCode": null, "define": "DESCRIPTOR_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Descriptor", @@ -3611,40 +3418,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -3653,41 +3426,7 @@ "mfgCode": null, "define": "WAKE_ON_LAN_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Channel", @@ -3721,53 +3460,19 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ + ] + }, + { + "name": "Target Navigator", + "code": 1285, + "mfgCode": null, + "define": "TARGET_NAVIGATOR_CLUSTER", + "side": "client", + "enabled": 1, + "commands": [ { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Target Navigator", - "code": 1285, - "mfgCode": null, - "define": "TARGET_NAVIGATOR_CLUSTER", - "side": "client", - "enabled": 1, - "commands": [ - { - "name": "NavigateTarget", - "code": 0, + "name": "NavigateTarget", + "code": 0, "mfgCode": null, "source": "client", "isIncoming": 0, @@ -3781,40 +3486,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3921,40 +3592,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3997,40 +3634,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -4049,40 +3652,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -4109,40 +3678,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -4169,40 +3704,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -4229,40 +3730,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -4305,40 +3772,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -4347,41 +3780,7 @@ "mfgCode": null, "define": "APPLICATION_BASIC_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Account Login", @@ -4423,40 +3822,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -4556,40 +3921,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { diff --git a/examples/window-app/common/window-app.zap b/examples/window-app/common/window-app.zap index 85c01e1e6b52ff..64f9a634e4871a 100644 --- a/examples/window-app/common/window-app.zap +++ b/examples/window-app/common/window-app.zap @@ -954,24 +954,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/scripts/py_matter_idl/matter_idl/tests/inputs/large_all_clusters_app.matter b/scripts/py_matter_idl/matter_idl/tests/inputs/large_all_clusters_app.matter index ef27e45d2c66c7..607ccd40f9c9b4 100644 --- a/scripts/py_matter_idl/matter_idl/tests/inputs/large_all_clusters_app.matter +++ b/scripts/py_matter_idl/matter_idl/tests/inputs/large_all_clusters_app.matter @@ -269,13 +269,6 @@ server cluster OnOff = 6 { command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; } -server cluster OnOffSwitchConfiguration = 7 { - readonly attribute enum8 switchType = 0; - attribute enum8 switchActions = 16; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - server cluster LevelControl = 8 { enum MoveMode : ENUM8 { kUp = 0; @@ -2460,22 +2453,6 @@ server cluster WindowCovering = 258 { command GoToTiltPercentage(GoToTiltPercentageRequest): DefaultSuccess = 8; } -server cluster BarrierControl = 259 { - readonly attribute enum8 barrierMovingState = 1; - readonly attribute bitmap16 barrierSafetyStatus = 2; - readonly attribute bitmap8 barrierCapabilities = 3; - readonly attribute int8u barrierPosition = 10; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct BarrierControlGoToPercentRequest { - INT8U percentOpen = 0; - } - - command BarrierControlGoToPercent(BarrierControlGoToPercentRequest): DefaultSuccess = 0; - command BarrierControlStop(): DefaultSuccess = 1; -} - server cluster PumpConfigurationAndControl = 512 { enum PumpControlMode : ENUM8 { kConstantSpeed = 0; @@ -3514,22 +3491,6 @@ server cluster AccountLogin = 1294 { readonly attribute int16u clusterRevision = 65533; } -server cluster ElectricalMeasurement = 2820 { - readonly attribute bitmap32 measurementType = 0; - readonly attribute int32s totalActivePower = 772; - readonly attribute int16u rmsVoltage = 1285; - readonly attribute int16u rmsVoltageMin = 1286; - readonly attribute int16u rmsVoltageMax = 1287; - readonly attribute int16u rmsCurrent = 1288; - readonly attribute int16u rmsCurrentMin = 1289; - readonly attribute int16u rmsCurrentMax = 1290; - readonly attribute int16s activePower = 1291; - readonly attribute int16s activePowerMin = 1292; - readonly attribute int16s activePowerMax = 1293; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - server cluster UnitTesting = 4294048773 { enum SimpleEnum : ENUM8 { kUnspecified = 0; @@ -4239,13 +4200,6 @@ endpoint 1 { ram attribute clusterRevision default = 4; } - server cluster OnOffSwitchConfiguration { - ram attribute switchType; - ram attribute switchActions; - ram attribute featureMap; - ram attribute clusterRevision default = 1; - } - server cluster LevelControl { persist attribute currentLevel default = 0xFE; ram attribute remainingTime; @@ -4414,15 +4368,6 @@ endpoint 1 { ram attribute clusterRevision default = 5; } - server cluster BarrierControl { - ram attribute barrierMovingState; - ram attribute barrierSafetyStatus; - ram attribute barrierCapabilities; - ram attribute barrierPosition; - ram attribute featureMap; - ram attribute clusterRevision default = 1; - } - server cluster PumpConfigurationAndControl { ram attribute maxPressure; ram attribute maxSpeed; @@ -4691,22 +4636,6 @@ endpoint 1 { ram attribute clusterRevision default = 1; } - server cluster ElectricalMeasurement { - ram attribute measurementType; - ram attribute totalActivePower; - ram attribute rmsVoltage default = 0xffff; - ram attribute rmsVoltageMin default = 0x8000; - ram attribute rmsVoltageMax default = 0x8000; - ram attribute rmsCurrent default = 0xffff; - ram attribute rmsCurrentMin default = 0xffff; - ram attribute rmsCurrentMax default = 0xffff; - ram attribute activePower default = 0xffff; - ram attribute activePowerMin default = 0xffff; - ram attribute activePowerMax default = 0xffff; - ram attribute featureMap; - ram attribute clusterRevision default = 3; - } - server cluster UnitTesting { ram attribute boolean; ram attribute bitmap8; diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/PluginApplicationCallbacks.h b/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/PluginApplicationCallbacks.h index 67bd61c9519d3c..b8c83f683e5bf6 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/PluginApplicationCallbacks.h +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/PluginApplicationCallbacks.h @@ -6,7 +6,6 @@ void MatterAdministratorCommissioningPluginServerInitCallback(); void MatterApplicationBasicPluginServerInitCallback(); void MatterApplicationLauncherPluginServerInitCallback(); void MatterAudioOutputPluginServerInitCallback(); -void MatterBarrierControlPluginServerInitCallback(); void MatterBasicInformationPluginServerInitCallback(); void MatterBinaryInputBasicPluginServerInitCallback(); void MatterBindingPluginServerInitCallback(); @@ -17,7 +16,6 @@ void MatterContentLauncherPluginServerInitCallback(); void MatterDescriptorPluginServerInitCallback(); void MatterDiagnosticLogsPluginServerInitCallback(); void MatterDoorLockPluginServerInitCallback(); -void MatterElectricalMeasurementPluginServerInitCallback(); void MatterEthernetNetworkDiagnosticsPluginServerInitCallback(); void MatterFanControlPluginServerInitCallback(); void MatterFaultInjectionPluginServerInitCallback(); @@ -40,7 +38,6 @@ void MatterModeSelectPluginServerInitCallback(); void MatterNetworkCommissioningPluginServerInitCallback(); void MatterOccupancySensingPluginServerInitCallback(); void MatterOnOffPluginServerInitCallback(); -void MatterOnOffSwitchConfigurationPluginServerInitCallback(); void MatterOperationalCredentialsPluginServerInitCallback(); void MatterOtaSoftwareUpdateRequestorPluginServerInitCallback(); void MatterPowerSourcePluginServerInitCallback(); @@ -71,7 +68,6 @@ void MatterWindowCoveringPluginServerInitCallback(); MatterApplicationBasicPluginServerInitCallback(); \ MatterApplicationLauncherPluginServerInitCallback(); \ MatterAudioOutputPluginServerInitCallback(); \ - MatterBarrierControlPluginServerInitCallback(); \ MatterBasicInformationPluginServerInitCallback(); \ MatterBinaryInputBasicPluginServerInitCallback(); \ MatterBindingPluginServerInitCallback(); \ @@ -82,7 +78,6 @@ void MatterWindowCoveringPluginServerInitCallback(); MatterDescriptorPluginServerInitCallback(); \ MatterDiagnosticLogsPluginServerInitCallback(); \ MatterDoorLockPluginServerInitCallback(); \ - MatterElectricalMeasurementPluginServerInitCallback(); \ MatterEthernetNetworkDiagnosticsPluginServerInitCallback(); \ MatterFanControlPluginServerInitCallback(); \ MatterFaultInjectionPluginServerInitCallback(); \ @@ -105,7 +100,6 @@ void MatterWindowCoveringPluginServerInitCallback(); MatterNetworkCommissioningPluginServerInitCallback(); \ MatterOccupancySensingPluginServerInitCallback(); \ MatterOnOffPluginServerInitCallback(); \ - MatterOnOffSwitchConfigurationPluginServerInitCallback(); \ MatterOperationalCredentialsPluginServerInitCallback(); \ MatterOtaSoftwareUpdateRequestorPluginServerInitCallback(); \ MatterPowerSourcePluginServerInitCallback(); \ diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/callback-stub.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/callback-stub.cpp index 74735c9fe8036e..49c67f436a1120 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/callback-stub.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/callback-stub.cpp @@ -36,11 +36,6 @@ void __attribute__((weak)) emberAfAudioOutputClusterInitCallback(EndpointId endp // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfBarrierControlClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} void __attribute__((weak)) emberAfBasicInformationClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -91,11 +86,6 @@ void __attribute__((weak)) emberAfDoorLockClusterInitCallback(EndpointId endpoin // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfElectricalMeasurementClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} void __attribute__((weak)) emberAfEthernetNetworkDiagnosticsClusterInitCallback(EndpointId endpoint) { // To prevent warning @@ -206,11 +196,6 @@ void __attribute__((weak)) emberAfOnOffClusterInitCallback(EndpointId endpoint) // To prevent warning (void) endpoint; } -void __attribute__((weak)) emberAfOnOffSwitchConfigurationClusterInitCallback(EndpointId endpoint) -{ - // To prevent warning - (void) endpoint; -} void __attribute__((weak)) emberAfOperationalCredentialsClusterInitCallback(EndpointId endpoint) { // To prevent warning diff --git a/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/cluster-init-callback.cpp b/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/cluster-init-callback.cpp index 8144c53c404e9f..650d59d3dddf05 100644 --- a/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/cluster-init-callback.cpp +++ b/scripts/py_matter_idl/matter_idl/tests/outputs/large_all_clusters_app/cpp-app/cluster-init-callback.cpp @@ -31,9 +31,6 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case app::Clusters::AudioOutput::Id: emberAfAudioOutputClusterInitCallback(endpoint); break; - case app::Clusters::BarrierControl::Id: - emberAfBarrierControlClusterInitCallback(endpoint); - break; case app::Clusters::BasicInformation::Id: emberAfBasicInformationClusterInitCallback(endpoint); break; @@ -64,9 +61,6 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case app::Clusters::DoorLock::Id: emberAfDoorLockClusterInitCallback(endpoint); break; - case app::Clusters::ElectricalMeasurement::Id: - emberAfElectricalMeasurementClusterInitCallback(endpoint); - break; case app::Clusters::EthernetNetworkDiagnostics::Id: emberAfEthernetNetworkDiagnosticsClusterInitCallback(endpoint); break; @@ -133,9 +127,6 @@ void emberAfClusterInitCallback(EndpointId endpoint, ClusterId clusterId) case app::Clusters::OnOff::Id: emberAfOnOffClusterInitCallback(endpoint); break; - case app::Clusters::OnOffSwitchConfiguration::Id: - emberAfOnOffSwitchConfigurationClusterInitCallback(endpoint); - break; case app::Clusters::OperationalCredentials::Id: emberAfOperationalCredentialsClusterInitCallback(endpoint); break; diff --git a/scripts/rules.matterlint b/scripts/rules.matterlint index ee27673ae5bb0b..e7bd644249a13e 100644 --- a/scripts/rules.matterlint +++ b/scripts/rules.matterlint @@ -117,10 +117,6 @@ load "../src/app/zap-templates/zcl/data-model/chip/resource-monitoring-cluster.x load "../src/app/zap-templates/zcl/data-model/chip/sample-mei-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/electrical-energy-measurement-cluster.xml"; load "../src/app/zap-templates/zcl/data-model/chip/electrical-power-measurement-cluster.xml"; -load "../src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml"; -load "../src/app/zap-templates/zcl/data-model/draft/electrical-measurement-cluster.xml"; -load "../src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters.xml"; -load "../src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml"; all endpoints { // These attributes follow a different code path and do not have to be diff --git a/scripts/tests/chiptest/__init__.py b/scripts/tests/chiptest/__init__.py index 2826e506382556..161d3b8c0cdcc1 100644 --- a/scripts/tests/chiptest/__init__.py +++ b/scripts/tests/chiptest/__init__.py @@ -38,7 +38,6 @@ class ManualTest: INVALID_TESTS = { - "tests.yaml", # certification/tests.yaml is not a real test "PICS.yaml", # certification/PICS.yaml is not a real test # The items below are examples and will never work (likely) diff --git a/scripts/tools/zap/tests/inputs/all-clusters-app.zap b/scripts/tools/zap/tests/inputs/all-clusters-app.zap index 9d4ae062f054c8..77c492dad171ef 100644 --- a/scripts/tools/zap/tests/inputs/all-clusters-app.zap +++ b/scripts/tools/zap/tests/inputs/all-clusters-app.zap @@ -1176,24 +1176,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -6540,40 +6522,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -6812,81 +6760,6 @@ } ] }, - { - "name": "On/off Switch Configuration", - "code": 7, - "mfgCode": null, - "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", - "side": "server", - "enabled": 1, - "apiMaturity": "deprecated", - "attributes": [ - { - "name": "switch type", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "switch actions", - "code": 16, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Level Control", "code": 8, @@ -7219,97 +7092,6 @@ } ] }, - { - "name": "Binary Input (Basic)", - "code": 15, - "mfgCode": null, - "define": "BINARY_INPUT_BASIC_CLUSTER", - "side": "server", - "enabled": 1, - "apiMaturity": "deprecated", - "attributes": [ - { - "name": "out of service", - "code": 81, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "present value", - "code": 85, - "mfgCode": null, - "side": "server", - "type": "boolean", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "status flags", - "code": 111, - "mfgCode": null, - "side": "server", - "type": "bitmap8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x00", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Descriptor", "code": 29, @@ -15278,131 +15060,6 @@ } ] }, - { - "name": "Barrier Control", - "code": 259, - "mfgCode": null, - "define": "BARRIER_CONTROL_CLUSTER", - "side": "server", - "enabled": 1, - "apiMaturity": "deprecated", - "commands": [ - { - "name": "BarrierControlGoToPercent", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "BarrierControlStop", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "barrier moving state", - "code": 1, - "mfgCode": null, - "side": "server", - "type": "enum8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "barrier safety status", - "code": 2, - "mfgCode": null, - "side": "server", - "type": "bitmap16", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "barrier capabilities", - "code": 3, - "mfgCode": null, - "side": "server", - "type": "bitmap8", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "barrier position", - "code": 10, - "mfgCode": null, - "side": "server", - "type": "int8u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Pump Configuration and Control", "code": 512, @@ -21412,225 +21069,6 @@ } ] }, - { - "name": "Electrical Measurement", - "code": 2820, - "mfgCode": null, - "define": "ELECTRICAL_MEASUREMENT_CLUSTER", - "side": "server", - "enabled": 1, - "apiMaturity": "deprecated", - "attributes": [ - { - "name": "measurement type", - "code": 0, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "total active power", - "code": 772, - "mfgCode": null, - "side": "server", - "type": "int32s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x000000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rms voltage", - "code": 1285, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rms voltage min", - "code": 1286, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x8000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rms voltage max", - "code": 1287, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0x8000", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rms current", - "code": 1288, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rms current min", - "code": 1289, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "rms current max", - "code": 1290, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "active power", - "code": 1291, - "mfgCode": null, - "side": "server", - "type": "int16s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "active power min", - "code": 1292, - "mfgCode": null, - "side": "server", - "type": "int16s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "active power max", - "code": 1293, - "mfgCode": null, - "side": "server", - "type": "int16s", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0xffff", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - }, - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "server", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "server", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, { "name": "Unit Testing", "code": 4294048773, diff --git a/scripts/tools/zap/tests/inputs/lighting-app.zap b/scripts/tools/zap/tests/inputs/lighting-app.zap index b0bb70a68fbe5d..808a1e7de7b2ae 100644 --- a/scripts/tools/zap/tests/inputs/lighting-app.zap +++ b/scripts/tools/zap/tests/inputs/lighting-app.zap @@ -770,24 +770,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/IMClusterCommandHandler.cpp b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/IMClusterCommandHandler.cpp index dbfbc68a2bcf2f..bd3030cf63ddc9 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/IMClusterCommandHandler.cpp +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/IMClusterCommandHandler.cpp @@ -95,52 +95,6 @@ void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandP } // namespace AdministratorCommissioning -namespace BarrierControl { - -void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) -{ - CHIP_ERROR TLVError = CHIP_NO_ERROR; - bool wasHandled = false; - { - switch (aCommandPath.mCommandId) - { - case Commands::BarrierControlGoToPercent::Id: { - Commands::BarrierControlGoToPercent::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBarrierControlClusterBarrierControlGoToPercentCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - case Commands::BarrierControlStop::Id: { - Commands::BarrierControlStop::DecodableType commandData; - TLVError = DataModel::Decode(aDataTlv, commandData); - if (TLVError == CHIP_NO_ERROR) - { - wasHandled = emberAfBarrierControlClusterBarrierControlStopCallback(apCommandObj, aCommandPath, commandData); - } - break; - } - default: { - // Unrecognized command ID, error status will apply. - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::UnsupportedCommand); - ChipLogError(Zcl, "Unknown command " ChipLogFormatMEI " for cluster " ChipLogFormatMEI, - ChipLogValueMEI(aCommandPath.mCommandId), ChipLogValueMEI(aCommandPath.mClusterId)); - return; - } - } - } - - if (CHIP_NO_ERROR != TLVError || !wasHandled) - { - apCommandObj->AddStatus(aCommandPath, Protocols::InteractionModel::Status::InvalidCommand); - ChipLogProgress(Zcl, "Failed to dispatch command, TLVError=%" CHIP_ERROR_FORMAT, TLVError.Format()); - } -} - -} // namespace BarrierControl - namespace BooleanStateConfiguration { void DispatchServerCommand(CommandHandler * apCommandObj, const ConcreteCommandPath & aCommandPath, TLV::TLVReader & aDataTlv) @@ -1983,9 +1937,6 @@ void DispatchSingleClusterCommand(const ConcreteCommandPath & aCommandPath, TLV: case Clusters::AdministratorCommissioning::Id: Clusters::AdministratorCommissioning::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; - case Clusters::BarrierControl::Id: - Clusters::BarrierControl::DispatchServerCommand(apCommandObj, aCommandPath, aReader); - break; case Clusters::BooleanStateConfiguration::Id: Clusters::BooleanStateConfiguration::DispatchServerCommand(apCommandObj, aCommandPath, aReader); break; diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h index 08646d26bc566d..cc52961a0aa087 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/endpoint_config.h @@ -261,7 +261,7 @@ #define GENERATED_DEFAULTS_COUNT (30) // This is an array of EmberAfAttributeMinMaxValue structures. -#define GENERATED_MIN_MAX_DEFAULT_COUNT 50 +#define GENERATED_MIN_MAX_DEFAULT_COUNT 48 #define GENERATED_MIN_MAX_DEFAULTS \ { \ \ @@ -271,16 +271,10 @@ /* Endpoint: 1, Cluster: On/Off (server) */ \ { (uint16_t) 0xFF, (uint16_t) 0x0, (uint16_t) 0x2 }, /* StartUpOnOff */ \ \ - /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x2 }, /* switch actions */ \ - \ /* Endpoint: 1, Cluster: Level Control (server) */ \ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x3 }, /* Options */ \ { (uint16_t) 0x32, (uint16_t) 0x1, (uint16_t) 0xFF }, /* DefaultMoveRate */ \ \ - /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ - { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1 }, /* out of service */ \ - \ /* Endpoint: 1, Cluster: Laundry Washer Controls (server) */ \ { (uint16_t) 0x0, (uint16_t) 0x0, (uint16_t) 0x1F }, /* SpinSpeedCurrent */ \ \ @@ -355,7 +349,7 @@ } // This is an array of EmberAfAttributeMetadata structures. -#define GENERATED_ATTRIBUTE_COUNT 1050 +#define GENERATED_ATTRIBUTE_COUNT 1022 #define GENERATED_ATTRIBUTES \ { \ \ @@ -797,13 +791,6 @@ { ZAP_SIMPLE_DEFAULT(0x0001), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(6), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000000, 1, ZAP_TYPE(ENUM8), 0 }, /* switch type */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(2), 0x00000010, 1, ZAP_TYPE(ENUM8), \ - ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* switch actions */ \ - { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ - { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ - \ /* Endpoint: 1, Cluster: Level Control (server) */ \ { ZAP_SIMPLE_DEFAULT(0xFE), 0x00000000, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* CurrentLevel */ \ @@ -813,7 +800,7 @@ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000004, 2, ZAP_TYPE(INT16U), 0 }, /* CurrentFrequency */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000005, 2, ZAP_TYPE(INT16U), 0 }, /* MinFrequency */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000006, 2, ZAP_TYPE(INT16U), 0 }, /* MaxFrequency */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(3), 0x0000000F, 1, ZAP_TYPE(BITMAP8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(2), 0x0000000F, 1, ZAP_TYPE(BITMAP8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* Options */ \ { ZAP_SIMPLE_DEFAULT(0x0000), 0x00000010, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OnOffTransitionTime */ \ @@ -823,7 +810,7 @@ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* OnTransitionTime */ \ { ZAP_EMPTY_DEFAULT(), 0x00000013, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* OffTransitionTime */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(4), 0x00000014, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(3), 0x00000014, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* DefaultMoveRate */ \ { ZAP_SIMPLE_DEFAULT(255), 0x00004000, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ @@ -831,14 +818,6 @@ { ZAP_SIMPLE_DEFAULT(3), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(6), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(5), 0x00000051, 1, ZAP_TYPE(BOOLEAN), \ - ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* out of service */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000055, 1, ZAP_TYPE(BOOLEAN), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* present value */ \ - { ZAP_SIMPLE_DEFAULT(0x00), 0x0000006F, 1, ZAP_TYPE(BITMAP8), 0 }, /* status flags */ \ - { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ - { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ - \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ { ZAP_EMPTY_DEFAULT(), 0x00000000, 0, ZAP_TYPE(ARRAY), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* DeviceTypeList */ \ { ZAP_EMPTY_DEFAULT(), 0x00000001, 0, ZAP_TYPE(ARRAY), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* ServerList */ \ @@ -960,7 +939,7 @@ \ /* Endpoint: 1, Cluster: Laundry Washer Controls (server) */ \ { ZAP_EMPTY_DEFAULT(), 0x00000000, 0, ZAP_TYPE(ARRAY), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* SpinSpeeds */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(6), 0x00000001, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(4), 0x00000001, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* SpinSpeedCurrent */ \ { ZAP_EMPTY_DEFAULT(), 0x00000002, 1, ZAP_TYPE(ENUM8), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* NumberOfRinses */ \ { ZAP_EMPTY_DEFAULT(), 0x00000003, 0, ZAP_TYPE(ARRAY), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* SupportedRinses */ \ @@ -1021,7 +1000,7 @@ { ZAP_SIMPLE_DEFAULT(0), 0x00000008, 1, ZAP_TYPE(ENUM8), 0 }, /* InterconnectSmokeAlarm */ \ { ZAP_SIMPLE_DEFAULT(0), 0x00000009, 1, ZAP_TYPE(ENUM8), 0 }, /* InterconnectCOAlarm */ \ { ZAP_SIMPLE_DEFAULT(0), 0x0000000A, 1, ZAP_TYPE(ENUM8), 0 }, /* ContaminationState */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(7), 0x0000000B, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(5), 0x0000000B, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* SmokeSensitivityLevel */ \ { ZAP_SIMPLE_DEFAULT(0), 0x0000000C, 4, ZAP_TYPE(EPOCH_S), 0 }, /* ExpiryDate */ \ { ZAP_SIMPLE_DEFAULT(3), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ @@ -1133,7 +1112,7 @@ { ZAP_SIMPLE_DEFAULT(0xFF), 0x00000005, 1, ZAP_TYPE(ENUM8), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* TargetState */ \ { ZAP_SIMPLE_DEFAULT(0xFF), 0x00000006, 1, ZAP_TYPE(PERCENT), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* CurrentLevel */ \ { ZAP_SIMPLE_DEFAULT(0xFF), 0x00000007, 1, ZAP_TYPE(PERCENT), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* TargetLevel */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(8), 0x00000008, 1, ZAP_TYPE(PERCENT), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(6), 0x00000008, 1, ZAP_TYPE(PERCENT), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* DefaultOpenLevel */ \ { ZAP_SIMPLE_DEFAULT(0), 0x00000009, 2, ZAP_TYPE(BITMAP16), 0 }, /* ValveFault */ \ { ZAP_SIMPLE_DEFAULT(1), 0x0000000A, 1, ZAP_TYPE(INT8U), 0 }, /* LevelStep */ \ @@ -1233,7 +1212,7 @@ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* NextChargeRequiredEnergy */ \ { ZAP_EMPTY_DEFAULT(), 0x00000026, 1, ZAP_TYPE(PERCENT), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* NextChargeTargetSoC */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(9), 0x00000027, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(7), 0x00000027, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* ApproximateEVEfficiency */ \ { ZAP_EMPTY_DEFAULT(), 0x00000040, 4, ZAP_TYPE(INT32U), \ @@ -1310,20 +1289,12 @@ ZAP_ATTRIBUTE_MASK(TOKENIZE) }, /* InstalledOpenLimitTilt */ \ { ZAP_SIMPLE_DEFAULT(0xFFFF), 0x00000013, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(TOKENIZE) }, /* InstalledClosedLimitTilt */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(10), 0x00000017, 1, ZAP_TYPE(BITMAP8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(8), 0x00000017, 1, ZAP_TYPE(BITMAP8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* Mode */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x0000001A, 2, ZAP_TYPE(BITMAP16), 0 }, /* SafetyStatus */ \ { ZAP_SIMPLE_DEFAULT(0x17), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(5), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: Barrier Control (server) */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000001, 1, ZAP_TYPE(ENUM8), 0 }, /* barrier moving state */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000002, 2, ZAP_TYPE(BITMAP16), 0 }, /* barrier safety status */ \ - { ZAP_EMPTY_DEFAULT(), 0x00000003, 1, ZAP_TYPE(BITMAP8), 0 }, /* barrier capabilities */ \ - { ZAP_EMPTY_DEFAULT(), 0x0000000A, 1, ZAP_TYPE(INT8U), 0 }, /* barrier position */ \ - { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ - { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ - \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ { ZAP_EMPTY_DEFAULT(), 0x00000000, 2, ZAP_TYPE(INT16S), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MaxPressure */ \ { ZAP_EMPTY_DEFAULT(), 0x00000001, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* MaxSpeed */ \ @@ -1348,9 +1319,9 @@ { ZAP_EMPTY_DEFAULT(), 0x00000016, 3, ZAP_TYPE(INT24U), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* Power */ \ { ZAP_SIMPLE_DEFAULT(0x00000000), 0x00000017, 4, ZAP_TYPE(INT32U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* LifetimeEnergyConsumed */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(11), 0x00000020, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(9), 0x00000020, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OperationMode */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(12), 0x00000021, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(10), 0x00000021, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ControlMode */ \ { ZAP_SIMPLE_DEFAULT(0x1F), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(4), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ @@ -1361,23 +1332,23 @@ { ZAP_SIMPLE_DEFAULT(0x0BB8), 0x00000004, 2, ZAP_TYPE(TEMPERATURE), 0 }, /* AbsMaxHeatSetpointLimit */ \ { ZAP_SIMPLE_DEFAULT(0x0640), 0x00000005, 2, ZAP_TYPE(TEMPERATURE), 0 }, /* AbsMinCoolSetpointLimit */ \ { ZAP_SIMPLE_DEFAULT(0x0C80), 0x00000006, 2, ZAP_TYPE(TEMPERATURE), 0 }, /* AbsMaxCoolSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(13), 0x00000011, 2, ZAP_TYPE(TEMPERATURE), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(11), 0x00000011, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OccupiedCoolingSetpoint */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(14), 0x00000012, 2, ZAP_TYPE(TEMPERATURE), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(12), 0x00000012, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OccupiedHeatingSetpoint */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(15), 0x00000015, 2, ZAP_TYPE(TEMPERATURE), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(13), 0x00000015, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinHeatSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(16), 0x00000016, 2, ZAP_TYPE(TEMPERATURE), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(14), 0x00000016, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MaxHeatSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(17), 0x00000017, 2, ZAP_TYPE(TEMPERATURE), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(15), 0x00000017, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinCoolSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(18), 0x00000018, 2, ZAP_TYPE(TEMPERATURE), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(16), 0x00000018, 2, ZAP_TYPE(TEMPERATURE), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MaxCoolSetpointLimit */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(19), 0x00000019, 1, ZAP_TYPE(INT8S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(17), 0x00000019, 1, ZAP_TYPE(INT8S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinSetpointDeadBand */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(20), 0x0000001B, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(18), 0x0000001B, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ControlSequenceOfOperation */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(21), 0x0000001C, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(19), 0x0000001C, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* SystemMode */ \ { ZAP_EMPTY_DEFAULT(), 0x00000048, 0, ZAP_TYPE(ARRAY), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* PresetTypes */ \ { ZAP_EMPTY_DEFAULT(), 0x00000049, 0, ZAP_TYPE(ARRAY), ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) }, /* ScheduleTypes */ \ @@ -1399,14 +1370,14 @@ { ZAP_SIMPLE_DEFAULT(6), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Fan Control (server) */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(22), 0x00000000, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(20), 0x00000000, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* FanMode */ \ { ZAP_SIMPLE_DEFAULT(0x02), 0x00000001, 1, ZAP_TYPE(ENUM8), 0 }, /* FanModeSequence */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(23), 0x00000002, 1, ZAP_TYPE(PERCENT), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(21), 0x00000002, 1, ZAP_TYPE(PERCENT), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* PercentSetting */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x00000003, 1, ZAP_TYPE(PERCENT), 0 }, /* PercentCurrent */ \ { ZAP_SIMPLE_DEFAULT(100), 0x00000004, 1, ZAP_TYPE(INT8U), 0 }, /* SpeedMax */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(24), 0x00000005, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(22), 0x00000005, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* SpeedSetting */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x00000006, 1, ZAP_TYPE(INT8U), 0 }, /* SpeedCurrent */ \ { ZAP_SIMPLE_DEFAULT(0x03), 0x00000007, 1, ZAP_TYPE(BITMAP8), 0 }, /* RockSupport */ \ @@ -1418,11 +1389,11 @@ { ZAP_SIMPLE_DEFAULT(4), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(25), 0x00000000, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(23), 0x00000000, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* TemperatureDisplayMode */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(26), 0x00000001, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(24), 0x00000001, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* KeypadLockout */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(27), 0x00000002, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(25), 0x00000002, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ScheduleProgrammingVisibility */ \ { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(2), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ @@ -1458,25 +1429,25 @@ { ZAP_EMPTY_DEFAULT(), 0x00000028, 2, ZAP_TYPE(INT16U), 0 }, /* Primary6X */ \ { ZAP_EMPTY_DEFAULT(), 0x00000029, 2, ZAP_TYPE(INT16U), 0 }, /* Primary6Y */ \ { ZAP_EMPTY_DEFAULT(), 0x0000002A, 1, ZAP_TYPE(INT8U), ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* Primary6Intensity */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(28), 0x00000030, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(26), 0x00000030, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* WhitePointX */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(29), 0x00000031, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(27), 0x00000031, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* WhitePointY */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(30), 0x00000032, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(28), 0x00000032, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointRX */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(31), 0x00000033, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(29), 0x00000033, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointRY */ \ { ZAP_EMPTY_DEFAULT(), 0x00000034, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* ColorPointRIntensity */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(32), 0x00000036, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(30), 0x00000036, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointGX */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(33), 0x00000037, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(31), 0x00000037, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointGY */ \ { ZAP_EMPTY_DEFAULT(), 0x00000038, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* ColorPointGIntensity */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(34), 0x0000003A, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(32), 0x0000003A, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointBX */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(35), 0x0000003B, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(33), 0x0000003B, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* ColorPointBY */ \ { ZAP_EMPTY_DEFAULT(), 0x0000003C, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* ColorPointBIntensity */ \ @@ -1492,7 +1463,7 @@ { ZAP_SIMPLE_DEFAULT(0x009A), 0x0000400B, 2, ZAP_TYPE(INT16U), 0 }, /* ColorTempPhysicalMinMireds */ \ { ZAP_SIMPLE_DEFAULT(0x01C6), 0x0000400C, 2, ZAP_TYPE(INT16U), 0 }, /* ColorTempPhysicalMaxMireds */ \ { ZAP_EMPTY_DEFAULT(), 0x0000400D, 2, ZAP_TYPE(INT16U), 0 }, /* CoupleColorTempToLevelMinMireds */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(36), 0x00004010, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(34), 0x00004010, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(TOKENIZE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* StartUpColorTemperatureMireds */ \ { ZAP_SIMPLE_DEFAULT(0x1F), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ @@ -1502,13 +1473,13 @@ { ZAP_SIMPLE_DEFAULT(0x01), 0x00000000, 1, ZAP_TYPE(INT8U), 0 }, /* PhysicalMinLevel */ \ { ZAP_SIMPLE_DEFAULT(0xFE), 0x00000001, 1, ZAP_TYPE(INT8U), 0 }, /* PhysicalMaxLevel */ \ { ZAP_SIMPLE_DEFAULT(0x00), 0x00000002, 1, ZAP_TYPE(BITMAP8), 0 }, /* BallastStatus */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(37), 0x00000010, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(35), 0x00000010, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MinLevel */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(38), 0x00000011, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(36), 0x00000011, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* MaxLevel */ \ { ZAP_EMPTY_DEFAULT(), 0x00000014, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* IntrinsicBallastFactor */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(39), 0x00000015, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(37), 0x00000015, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* BallastFactorAdjustment */ \ { ZAP_EMPTY_DEFAULT(), 0x00000020, 1, ZAP_TYPE(INT8U), 0 }, /* LampQuantity */ \ @@ -1518,7 +1489,7 @@ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* LampRatedHours */ \ { ZAP_SIMPLE_DEFAULT(0x000000), 0x00000033, 3, ZAP_TYPE(INT24U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* LampBurnHours */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(40), 0x00000034, 1, ZAP_TYPE(BITMAP8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(38), 0x00000034, 1, ZAP_TYPE(BITMAP8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* LampAlarmMode */ \ { ZAP_SIMPLE_DEFAULT(0xFFFFFF), 0x00000035, 3, ZAP_TYPE(INT24U), \ ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* LampBurnHoursTripPoint */ \ @@ -1804,21 +1775,6 @@ { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(1), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ \ - /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ - { ZAP_SIMPLE_DEFAULT(0x000000), 0x00000000, 4, ZAP_TYPE(BITMAP32), 0 }, /* measurement type */ \ - { ZAP_SIMPLE_DEFAULT(0x000000), 0x00000304, 4, ZAP_TYPE(INT32S), 0 }, /* total active power */ \ - { ZAP_SIMPLE_DEFAULT(0xffff), 0x00000505, 2, ZAP_TYPE(INT16U), 0 }, /* rms voltage */ \ - { ZAP_SIMPLE_DEFAULT(0x8000), 0x00000506, 2, ZAP_TYPE(INT16U), 0 }, /* rms voltage min */ \ - { ZAP_SIMPLE_DEFAULT(0x8000), 0x00000507, 2, ZAP_TYPE(INT16U), 0 }, /* rms voltage max */ \ - { ZAP_SIMPLE_DEFAULT(0xffff), 0x00000508, 2, ZAP_TYPE(INT16U), 0 }, /* rms current */ \ - { ZAP_SIMPLE_DEFAULT(0xffff), 0x00000509, 2, ZAP_TYPE(INT16U), 0 }, /* rms current min */ \ - { ZAP_SIMPLE_DEFAULT(0xffff), 0x0000050A, 2, ZAP_TYPE(INT16U), 0 }, /* rms current max */ \ - { ZAP_SIMPLE_DEFAULT(0xffff), 0x0000050B, 2, ZAP_TYPE(INT16S), 0 }, /* active power */ \ - { ZAP_SIMPLE_DEFAULT(0xffff), 0x0000050C, 2, ZAP_TYPE(INT16S), 0 }, /* active power min */ \ - { ZAP_SIMPLE_DEFAULT(0xffff), 0x0000050D, 2, ZAP_TYPE(INT16S), 0 }, /* active power max */ \ - { ZAP_SIMPLE_DEFAULT(0), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ - { ZAP_SIMPLE_DEFAULT(3), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ - \ /* Endpoint: 1, Cluster: Unit Testing (server) */ \ { ZAP_SIMPLE_DEFAULT(false), 0x00000000, 1, ZAP_TYPE(BOOLEAN), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* boolean */ \ { ZAP_SIMPLE_DEFAULT(0), 0x00000001, 1, ZAP_TYPE(BITMAP8), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* bitmap8 */ \ @@ -1865,13 +1821,13 @@ { ZAP_EMPTY_DEFAULT(), 0x00000024, 1, ZAP_TYPE(ENUM8), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* enum_attr */ \ { ZAP_EMPTY_DEFAULT(), 0x00000025, 0, ZAP_TYPE(STRUCT), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* struct_attr */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(41), 0x00000026, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(39), 0x00000026, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* range_restricted_int8u */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(42), 0x00000027, 1, ZAP_TYPE(INT8S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(40), 0x00000027, 1, ZAP_TYPE(INT8S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* range_restricted_int8s */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(43), 0x00000028, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(41), 0x00000028, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* range_restricted_int16u */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(44), 0x00000029, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(42), 0x00000029, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* range_restricted_int16s */ \ { ZAP_EMPTY_DEFAULT(), 0x0000002A, 0, ZAP_TYPE(ARRAY), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* list_long_octet_string */ \ @@ -1942,16 +1898,16 @@ { ZAP_EMPTY_DEFAULT(), 0x00004025, 0, ZAP_TYPE(STRUCT), \ ZAP_ATTRIBUTE_MASK(EXTERNAL_STORAGE) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* nullable_struct */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(45), 0x00004026, 1, ZAP_TYPE(INT8U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(43), 0x00004026, 1, ZAP_TYPE(INT8U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* nullable_range_restricted_int8u */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(46), 0x00004027, 1, ZAP_TYPE(INT8S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(44), 0x00004027, 1, ZAP_TYPE(INT8S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* nullable_range_restricted_int8s */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(47), 0x00004028, 2, ZAP_TYPE(INT16U), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(45), 0x00004028, 2, ZAP_TYPE(INT16U), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* nullable_range_restricted_int16u */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(48), 0x00004029, 2, ZAP_TYPE(INT16S), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(46), 0x00004029, 2, ZAP_TYPE(INT16S), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | \ ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* nullable_range_restricted_int16s */ \ { ZAP_EMPTY_DEFAULT(), 0x0000402A, 1, ZAP_TYPE(INT8U), \ @@ -1976,7 +1932,7 @@ { ZAP_SIMPLE_DEFAULT(1), 0x00004000, 1, ZAP_TYPE(BOOLEAN), 0 }, /* GlobalSceneControl */ \ { ZAP_SIMPLE_DEFAULT(0), 0x00004001, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OnTime */ \ { ZAP_SIMPLE_DEFAULT(0), 0x00004002, 2, ZAP_TYPE(INT16U), ZAP_ATTRIBUTE_MASK(WRITABLE) }, /* OffWaitTime */ \ - { ZAP_MIN_MAX_DEFAULTS_INDEX(49), 0x00004003, 1, ZAP_TYPE(ENUM8), \ + { ZAP_MIN_MAX_DEFAULTS_INDEX(47), 0x00004003, 1, ZAP_TYPE(ENUM8), \ ZAP_ATTRIBUTE_MASK(MIN_MAX) | ZAP_ATTRIBUTE_MASK(WRITABLE) | ZAP_ATTRIBUTE_MASK(NULLABLE) }, /* StartUpOnOff */ \ { ZAP_SIMPLE_DEFAULT(0x0001), 0x0000FFFC, 4, ZAP_TYPE(BITMAP32), 0 }, /* FeatureMap */ \ { ZAP_SIMPLE_DEFAULT(6), 0x0000FFFD, 2, ZAP_TYPE(INT16U), 0 }, /* ClusterRevision */ \ @@ -2201,9 +2157,6 @@ const EmberAfGenericClusterFunction chipFuncArrayWindowCoveringServer[] = { \ (EmberAfGenericClusterFunction) MatterWindowCoveringClusterServerAttributeChangedCallback, \ }; \ - const EmberAfGenericClusterFunction chipFuncArrayBarrierControlServer[] = { \ - (EmberAfGenericClusterFunction) MatterBarrierControlClusterServerShutdownCallback, \ - }; \ const EmberAfGenericClusterFunction chipFuncArrayPumpConfigurationAndControlServer[] = { \ (EmberAfGenericClusterFunction) emberAfPumpConfigurationAndControlClusterServerInitCallback, \ (EmberAfGenericClusterFunction) MatterPumpConfigurationAndControlClusterServerAttributeChangedCallback, \ @@ -2573,27 +2526,22 @@ 0x00000007 /* GoToTiltValue */, \ 0x00000008 /* GoToTiltPercentage */, \ chip::kInvalidCommandId /* end of list */, \ - /* Endpoint: 1, Cluster: Barrier Control (server) */\ - /* AcceptedCommandList (index=235) */ \ - 0x00000000 /* BarrierControlGoToPercent */, \ - 0x00000001 /* BarrierControlStop */, \ - chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Thermostat (server) */\ - /* AcceptedCommandList (index=238) */ \ + /* AcceptedCommandList (index=235) */ \ 0x00000000 /* SetpointRaiseLower */, \ 0x00000005 /* SetActiveScheduleRequest */, \ 0x00000006 /* SetActivePresetRequest */, \ 0x000000FE /* AtomicRequest */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=243)*/ \ + /* GeneratedCommandList (index=240)*/ \ 0x000000FD /* AtomicResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Fan Control (server) */\ - /* AcceptedCommandList (index=245) */ \ + /* AcceptedCommandList (index=242) */ \ 0x00000000 /* Step */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Color Control (server) */\ - /* AcceptedCommandList (index=247) */ \ + /* AcceptedCommandList (index=244) */ \ 0x00000000 /* MoveToHue */, \ 0x00000001 /* MoveHue */, \ 0x00000002 /* StepHue */, \ @@ -2615,11 +2563,11 @@ 0x0000004C /* StepColorTemperature */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Low Power (server) */\ - /* AcceptedCommandList (index=267) */ \ + /* AcceptedCommandList (index=264) */ \ 0x00000000 /* Sleep */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 1, Cluster: Unit Testing (server) */\ - /* AcceptedCommandList (index=269) */ \ + /* AcceptedCommandList (index=266) */ \ 0x00000000 /* Test */, \ 0x00000001 /* TestNotHandled */, \ 0x00000002 /* TestSpecific */, \ @@ -2642,7 +2590,7 @@ 0x00000017 /* TestSecondBatchHelperRequest */, \ 0xFFF200AA /* TestDifferentVendorMeiRequest */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=291)*/ \ + /* GeneratedCommandList (index=288)*/ \ 0x00000000 /* TestSpecificResponse */, \ 0x00000001 /* TestAddArgumentsResponse */, \ 0x00000004 /* TestListInt8UReverseResponse */, \ @@ -2656,12 +2604,12 @@ 0xFFF200BB /* TestDifferentVendorMeiResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: Identify (server) */\ - /* AcceptedCommandList (index=303) */ \ + /* AcceptedCommandList (index=300) */ \ 0x00000000 /* Identify */, \ 0x00000040 /* TriggerEffect */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: Groups (server) */\ - /* AcceptedCommandList (index=306) */ \ + /* AcceptedCommandList (index=303) */ \ 0x00000000 /* AddGroup */, \ 0x00000001 /* ViewGroup */, \ 0x00000002 /* GetGroupMembership */, \ @@ -2669,14 +2617,14 @@ 0x00000004 /* RemoveAllGroups */, \ 0x00000005 /* AddGroupIfIdentifying */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=313)*/ \ + /* GeneratedCommandList (index=310)*/ \ 0x00000000 /* AddGroupResponse */, \ 0x00000001 /* ViewGroupResponse */, \ 0x00000002 /* GetGroupMembershipResponse */, \ 0x00000003 /* RemoveGroupResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: On/Off (server) */\ - /* AcceptedCommandList (index=318) */ \ + /* AcceptedCommandList (index=315) */ \ 0x00000000 /* Off */, \ 0x00000001 /* On */, \ 0x00000002 /* Toggle */, \ @@ -2685,7 +2633,7 @@ 0x00000042 /* OnWithTimedOff */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 2, Cluster: Scenes Management (server) */\ - /* AcceptedCommandList (index=325) */ \ + /* AcceptedCommandList (index=322) */ \ 0x00000000 /* AddScene */, \ 0x00000001 /* ViewScene */, \ 0x00000002 /* RemoveScene */, \ @@ -2695,7 +2643,7 @@ 0x00000006 /* GetSceneMembership */, \ 0x00000040 /* CopyScene */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=334)*/ \ + /* GeneratedCommandList (index=331)*/ \ 0x00000000 /* AddSceneResponse */, \ 0x00000001 /* ViewSceneResponse */, \ 0x00000002 /* RemoveSceneResponse */, \ @@ -2705,7 +2653,7 @@ 0x00000040 /* CopySceneResponse */, \ chip::kInvalidCommandId /* end of list */, \ /* Endpoint: 65534, Cluster: Network Commissioning (server) */\ - /* AcceptedCommandList (index=342) */ \ + /* AcceptedCommandList (index=339) */ \ 0x00000000 /* ScanNetworks */, \ 0x00000002 /* AddOrUpdateWiFiNetwork */, \ 0x00000003 /* AddOrUpdateThreadNetwork */, \ @@ -2713,7 +2661,7 @@ 0x00000006 /* ConnectNetwork */, \ 0x00000008 /* ReorderNetwork */, \ chip::kInvalidCommandId /* end of list */, \ - /* GeneratedCommandList (index=349)*/ \ + /* GeneratedCommandList (index=346)*/ \ 0x00000001 /* ScanNetworksResponse */, \ 0x00000005 /* NetworkConfigResponse */, \ 0x00000007 /* ConnectNetworkResponse */, \ @@ -2723,7 +2671,7 @@ // clang-format on // This is an array of EmberAfCluster structures. -#define GENERATED_CLUSTER_COUNT 111 +#define GENERATED_CLUSTER_COUNT 107 // clang-format off #define GENERATED_CLUSTERS { \ { \ @@ -3142,23 +3090,10 @@ .eventList = nullptr, \ .eventCount = 0, \ },\ - { \ - /* Endpoint: 1, Cluster: On/off Switch Configuration (server) */ \ - .clusterId = 0x00000007, \ - .attributes = ZAP_ATTRIBUTE_INDEX(264), \ - .attributeCount = 4, \ - .clusterSize = 8, \ - .mask = ZAP_CLUSTER_MASK(SERVER), \ - .functions = NULL, \ - .acceptedCommandList = nullptr, \ - .generatedCommandList = nullptr, \ - .eventList = nullptr, \ - .eventCount = 0, \ - },\ { \ /* Endpoint: 1, Cluster: Level Control (server) */ \ .clusterId = 0x00000008, \ - .attributes = ZAP_ATTRIBUTE_INDEX(268), \ + .attributes = ZAP_ATTRIBUTE_INDEX(264), \ .attributeCount = 16, \ .clusterSize = 27, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ @@ -3168,23 +3103,10 @@ .eventList = nullptr, \ .eventCount = 0, \ },\ - { \ - /* Endpoint: 1, Cluster: Binary Input (Basic) (server) */ \ - .clusterId = 0x0000000F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(284), \ - .attributeCount = 5, \ - .clusterSize = 9, \ - .mask = ZAP_CLUSTER_MASK(SERVER), \ - .functions = NULL, \ - .acceptedCommandList = nullptr, \ - .generatedCommandList = nullptr, \ - .eventList = nullptr, \ - .eventCount = 0, \ - },\ { \ /* Endpoint: 1, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(289), \ + .attributes = ZAP_ATTRIBUTE_INDEX(280), \ .attributeCount = 7, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3197,7 +3119,7 @@ { \ /* Endpoint: 1, Cluster: Binding (server) */ \ .clusterId = 0x0000001E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(296), \ + .attributes = ZAP_ATTRIBUTE_INDEX(287), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3210,7 +3132,7 @@ { \ /* Endpoint: 1, Cluster: Actions (server) */ \ .clusterId = 0x00000025, \ - .attributes = ZAP_ATTRIBUTE_INDEX(299), \ + .attributes = ZAP_ATTRIBUTE_INDEX(290), \ .attributeCount = 5, \ .clusterSize = 4, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3223,7 +3145,7 @@ { \ /* Endpoint: 1, Cluster: Power Source (server) */ \ .clusterId = 0x0000002F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(304), \ + .attributes = ZAP_ATTRIBUTE_INDEX(295), \ .attributeCount = 9, \ .clusterSize = 72, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3236,7 +3158,7 @@ { \ /* Endpoint: 1, Cluster: Switch (server) */ \ .clusterId = 0x0000003B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(313), \ + .attributes = ZAP_ATTRIBUTE_INDEX(304), \ .attributeCount = 4, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3249,7 +3171,7 @@ { \ /* Endpoint: 1, Cluster: Fixed Label (server) */ \ .clusterId = 0x00000040, \ - .attributes = ZAP_ATTRIBUTE_INDEX(317), \ + .attributes = ZAP_ATTRIBUTE_INDEX(308), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3262,7 +3184,7 @@ { \ /* Endpoint: 1, Cluster: User Label (server) */ \ .clusterId = 0x00000041, \ - .attributes = ZAP_ATTRIBUTE_INDEX(320), \ + .attributes = ZAP_ATTRIBUTE_INDEX(311), \ .attributeCount = 3, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3275,7 +3197,7 @@ { \ /* Endpoint: 1, Cluster: Boolean State (server) */ \ .clusterId = 0x00000045, \ - .attributes = ZAP_ATTRIBUTE_INDEX(323), \ + .attributes = ZAP_ATTRIBUTE_INDEX(314), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3288,7 +3210,7 @@ { \ /* Endpoint: 1, Cluster: Oven Cavity Operational State (server) */ \ .clusterId = 0x00000048, \ - .attributes = ZAP_ATTRIBUTE_INDEX(326), \ + .attributes = ZAP_ATTRIBUTE_INDEX(317), \ .attributeCount = 8, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3301,7 +3223,7 @@ { \ /* Endpoint: 1, Cluster: Oven Mode (server) */ \ .clusterId = 0x00000049, \ - .attributes = ZAP_ATTRIBUTE_INDEX(334), \ + .attributes = ZAP_ATTRIBUTE_INDEX(325), \ .attributeCount = 4, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3314,7 +3236,7 @@ { \ /* Endpoint: 1, Cluster: Laundry Dryer Controls (server) */ \ .clusterId = 0x0000004A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(338), \ + .attributes = ZAP_ATTRIBUTE_INDEX(329), \ .attributeCount = 4, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3327,7 +3249,7 @@ { \ /* Endpoint: 1, Cluster: Mode Select (server) */ \ .clusterId = 0x00000050, \ - .attributes = ZAP_ATTRIBUTE_INDEX(342), \ + .attributes = ZAP_ATTRIBUTE_INDEX(333), \ .attributeCount = 9, \ .clusterSize = 77, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3340,7 +3262,7 @@ { \ /* Endpoint: 1, Cluster: Laundry Washer Mode (server) */ \ .clusterId = 0x00000051, \ - .attributes = ZAP_ATTRIBUTE_INDEX(351), \ + .attributes = ZAP_ATTRIBUTE_INDEX(342), \ .attributeCount = 6, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3353,7 +3275,7 @@ { \ /* Endpoint: 1, Cluster: Refrigerator And Temperature Controlled Cabinet Mode (server) */ \ .clusterId = 0x00000052, \ - .attributes = ZAP_ATTRIBUTE_INDEX(357), \ + .attributes = ZAP_ATTRIBUTE_INDEX(348), \ .attributeCount = 6, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3366,7 +3288,7 @@ { \ /* Endpoint: 1, Cluster: Laundry Washer Controls (server) */ \ .clusterId = 0x00000053, \ - .attributes = ZAP_ATTRIBUTE_INDEX(363), \ + .attributes = ZAP_ATTRIBUTE_INDEX(354), \ .attributeCount = 6, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3379,7 +3301,7 @@ { \ /* Endpoint: 1, Cluster: RVC Run Mode (server) */ \ .clusterId = 0x00000054, \ - .attributes = ZAP_ATTRIBUTE_INDEX(369), \ + .attributes = ZAP_ATTRIBUTE_INDEX(360), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3392,7 +3314,7 @@ { \ /* Endpoint: 1, Cluster: RVC Clean Mode (server) */ \ .clusterId = 0x00000055, \ - .attributes = ZAP_ATTRIBUTE_INDEX(373), \ + .attributes = ZAP_ATTRIBUTE_INDEX(364), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3405,7 +3327,7 @@ { \ /* Endpoint: 1, Cluster: Temperature Control (server) */ \ .clusterId = 0x00000056, \ - .attributes = ZAP_ATTRIBUTE_INDEX(377), \ + .attributes = ZAP_ATTRIBUTE_INDEX(368), \ .attributeCount = 4, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3418,7 +3340,7 @@ { \ /* Endpoint: 1, Cluster: Refrigerator Alarm (server) */ \ .clusterId = 0x00000057, \ - .attributes = ZAP_ATTRIBUTE_INDEX(381), \ + .attributes = ZAP_ATTRIBUTE_INDEX(372), \ .attributeCount = 5, \ .clusterSize = 18, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3431,7 +3353,7 @@ { \ /* Endpoint: 1, Cluster: Dishwasher Mode (server) */ \ .clusterId = 0x00000059, \ - .attributes = ZAP_ATTRIBUTE_INDEX(386), \ + .attributes = ZAP_ATTRIBUTE_INDEX(377), \ .attributeCount = 6, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3444,7 +3366,7 @@ { \ /* Endpoint: 1, Cluster: Air Quality (server) */ \ .clusterId = 0x0000005B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(392), \ + .attributes = ZAP_ATTRIBUTE_INDEX(383), \ .attributeCount = 3, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3457,7 +3379,7 @@ { \ /* Endpoint: 1, Cluster: Smoke CO Alarm (server) */ \ .clusterId = 0x0000005C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(395), \ + .attributes = ZAP_ATTRIBUTE_INDEX(386), \ .attributeCount = 15, \ .clusterSize = 22, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3470,7 +3392,7 @@ { \ /* Endpoint: 1, Cluster: Dishwasher Alarm (server) */ \ .clusterId = 0x0000005D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(410), \ + .attributes = ZAP_ATTRIBUTE_INDEX(401), \ .attributeCount = 6, \ .clusterSize = 22, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3483,7 +3405,7 @@ { \ /* Endpoint: 1, Cluster: Microwave Oven Mode (server) */ \ .clusterId = 0x0000005E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(416), \ + .attributes = ZAP_ATTRIBUTE_INDEX(407), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3496,7 +3418,7 @@ { \ /* Endpoint: 1, Cluster: Operational State (server) */ \ .clusterId = 0x00000060, \ - .attributes = ZAP_ATTRIBUTE_INDEX(420), \ + .attributes = ZAP_ATTRIBUTE_INDEX(411), \ .attributeCount = 8, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3509,7 +3431,7 @@ { \ /* Endpoint: 1, Cluster: RVC Operational State (server) */ \ .clusterId = 0x00000061, \ - .attributes = ZAP_ATTRIBUTE_INDEX(428), \ + .attributes = ZAP_ATTRIBUTE_INDEX(419), \ .attributeCount = 8, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3522,7 +3444,7 @@ { \ /* Endpoint: 1, Cluster: Scenes Management (server) */ \ .clusterId = 0x00000062, \ - .attributes = ZAP_ATTRIBUTE_INDEX(436), \ + .attributes = ZAP_ATTRIBUTE_INDEX(427), \ .attributeCount = 5, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ @@ -3535,7 +3457,7 @@ { \ /* Endpoint: 1, Cluster: HEPA Filter Monitoring (server) */ \ .clusterId = 0x00000071, \ - .attributes = ZAP_ATTRIBUTE_INDEX(441), \ + .attributes = ZAP_ATTRIBUTE_INDEX(432), \ .attributeCount = 8, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3548,7 +3470,7 @@ { \ /* Endpoint: 1, Cluster: Activated Carbon Filter Monitoring (server) */ \ .clusterId = 0x00000072, \ - .attributes = ZAP_ATTRIBUTE_INDEX(449), \ + .attributes = ZAP_ATTRIBUTE_INDEX(440), \ .attributeCount = 8, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3561,7 +3483,7 @@ { \ /* Endpoint: 1, Cluster: Boolean State Configuration (server) */ \ .clusterId = 0x00000080, \ - .attributes = ZAP_ATTRIBUTE_INDEX(457), \ + .attributes = ZAP_ATTRIBUTE_INDEX(448), \ .attributeCount = 10, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3574,7 +3496,7 @@ { \ /* Endpoint: 1, Cluster: Valve Configuration and Control (server) */ \ .clusterId = 0x00000081, \ - .attributes = ZAP_ATTRIBUTE_INDEX(467), \ + .attributes = ZAP_ATTRIBUTE_INDEX(458), \ .attributeCount = 13, \ .clusterSize = 30, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3587,7 +3509,7 @@ { \ /* Endpoint: 1, Cluster: Electrical Power Measurement (server) */ \ .clusterId = 0x00000090, \ - .attributes = ZAP_ATTRIBUTE_INDEX(480), \ + .attributes = ZAP_ATTRIBUTE_INDEX(471), \ .attributeCount = 21, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3600,7 +3522,7 @@ { \ /* Endpoint: 1, Cluster: Electrical Energy Measurement (server) */ \ .clusterId = 0x00000091, \ - .attributes = ZAP_ATTRIBUTE_INDEX(501), \ + .attributes = ZAP_ATTRIBUTE_INDEX(492), \ .attributeCount = 8, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3613,7 +3535,7 @@ { \ /* Endpoint: 1, Cluster: Device Energy Management (server) */ \ .clusterId = 0x00000098, \ - .attributes = ZAP_ATTRIBUTE_INDEX(509), \ + .attributes = ZAP_ATTRIBUTE_INDEX(500), \ .attributeCount = 10, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3626,7 +3548,7 @@ { \ /* Endpoint: 1, Cluster: Energy EVSE (server) */ \ .clusterId = 0x00000099, \ - .attributes = ZAP_ATTRIBUTE_INDEX(519), \ + .attributes = ZAP_ATTRIBUTE_INDEX(510), \ .attributeCount = 19, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3639,7 +3561,7 @@ { \ /* Endpoint: 1, Cluster: Energy Preference (server) */ \ .clusterId = 0x0000009B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(538), \ + .attributes = ZAP_ATTRIBUTE_INDEX(529), \ .attributeCount = 7, \ .clusterSize = 8, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3652,7 +3574,7 @@ { \ /* Endpoint: 1, Cluster: Power Topology (server) */ \ .clusterId = 0x0000009C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(545), \ + .attributes = ZAP_ATTRIBUTE_INDEX(536), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3665,7 +3587,7 @@ { \ /* Endpoint: 1, Cluster: Energy EVSE Mode (server) */ \ .clusterId = 0x0000009D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(549), \ + .attributes = ZAP_ATTRIBUTE_INDEX(540), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3678,7 +3600,7 @@ { \ /* Endpoint: 1, Cluster: Device Energy Management Mode (server) */ \ .clusterId = 0x0000009F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(553), \ + .attributes = ZAP_ATTRIBUTE_INDEX(544), \ .attributeCount = 4, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3691,7 +3613,7 @@ { \ /* Endpoint: 1, Cluster: Window Covering (server) */ \ .clusterId = 0x00000102, \ - .attributes = ZAP_ATTRIBUTE_INDEX(557), \ + .attributes = ZAP_ATTRIBUTE_INDEX(548), \ .attributeCount = 24, \ .clusterSize = 43, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3701,23 +3623,10 @@ .eventList = nullptr, \ .eventCount = 0, \ },\ - { \ - /* Endpoint: 1, Cluster: Barrier Control (server) */ \ - .clusterId = 0x00000103, \ - .attributes = ZAP_ATTRIBUTE_INDEX(581), \ - .attributeCount = 6, \ - .clusterSize = 11, \ - .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ - .functions = chipFuncArrayBarrierControlServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 235 ), \ - .generatedCommandList = nullptr, \ - .eventList = nullptr, \ - .eventCount = 0, \ - },\ { \ /* Endpoint: 1, Cluster: Pump Configuration and Control (server) */ \ .clusterId = 0x00000200, \ - .attributes = ZAP_ATTRIBUTE_INDEX(587), \ + .attributes = ZAP_ATTRIBUTE_INDEX(572), \ .attributeCount = 25, \ .clusterSize = 52, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3730,25 +3639,25 @@ { \ /* Endpoint: 1, Cluster: Thermostat (server) */ \ .clusterId = 0x00000201, \ - .attributes = ZAP_ATTRIBUTE_INDEX(612), \ + .attributes = ZAP_ATTRIBUTE_INDEX(597), \ .attributeCount = 26, \ .clusterSize = 72, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayThermostatServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 238 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 243 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 235 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 240 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 1, Cluster: Fan Control (server) */ \ .clusterId = 0x00000202, \ - .attributes = ZAP_ATTRIBUTE_INDEX(638), \ + .attributes = ZAP_ATTRIBUTE_INDEX(623), \ .attributeCount = 14, \ .clusterSize = 18, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayFanControlServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 245 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 242 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3756,7 +3665,7 @@ { \ /* Endpoint: 1, Cluster: Thermostat User Interface Configuration (server) */ \ .clusterId = 0x00000204, \ - .attributes = ZAP_ATTRIBUTE_INDEX(652), \ + .attributes = ZAP_ATTRIBUTE_INDEX(637), \ .attributeCount = 5, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(PRE_ATTRIBUTE_CHANGED_FUNCTION), \ @@ -3769,12 +3678,12 @@ { \ /* Endpoint: 1, Cluster: Color Control (server) */ \ .clusterId = 0x00000300, \ - .attributes = ZAP_ATTRIBUTE_INDEX(657), \ + .attributes = ZAP_ATTRIBUTE_INDEX(642), \ .attributeCount = 54, \ .clusterSize = 345, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayColorControlServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 247 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 244 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -3782,7 +3691,7 @@ { \ /* Endpoint: 1, Cluster: Ballast Configuration (server) */ \ .clusterId = 0x00000301, \ - .attributes = ZAP_ATTRIBUTE_INDEX(711), \ + .attributes = ZAP_ATTRIBUTE_INDEX(696), \ .attributeCount = 16, \ .clusterSize = 58, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3795,7 +3704,7 @@ { \ /* Endpoint: 1, Cluster: Illuminance Measurement (server) */ \ .clusterId = 0x00000400, \ - .attributes = ZAP_ATTRIBUTE_INDEX(727), \ + .attributes = ZAP_ATTRIBUTE_INDEX(712), \ .attributeCount = 7, \ .clusterSize = 15, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3808,7 +3717,7 @@ { \ /* Endpoint: 1, Cluster: Temperature Measurement (server) */ \ .clusterId = 0x00000402, \ - .attributes = ZAP_ATTRIBUTE_INDEX(734), \ + .attributes = ZAP_ATTRIBUTE_INDEX(719), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3821,7 +3730,7 @@ { \ /* Endpoint: 1, Cluster: Pressure Measurement (server) */ \ .clusterId = 0x00000403, \ - .attributes = ZAP_ATTRIBUTE_INDEX(740), \ + .attributes = ZAP_ATTRIBUTE_INDEX(725), \ .attributeCount = 5, \ .clusterSize = 12, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3834,7 +3743,7 @@ { \ /* Endpoint: 1, Cluster: Flow Measurement (server) */ \ .clusterId = 0x00000404, \ - .attributes = ZAP_ATTRIBUTE_INDEX(745), \ + .attributes = ZAP_ATTRIBUTE_INDEX(730), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3847,7 +3756,7 @@ { \ /* Endpoint: 1, Cluster: Relative Humidity Measurement (server) */ \ .clusterId = 0x00000405, \ - .attributes = ZAP_ATTRIBUTE_INDEX(751), \ + .attributes = ZAP_ATTRIBUTE_INDEX(736), \ .attributeCount = 6, \ .clusterSize = 14, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3860,7 +3769,7 @@ { \ /* Endpoint: 1, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(757), \ + .attributes = ZAP_ATTRIBUTE_INDEX(742), \ .attributeCount = 5, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -3873,7 +3782,7 @@ { \ /* Endpoint: 1, Cluster: Carbon Monoxide Concentration Measurement (server) */ \ .clusterId = 0x0000040C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(762), \ + .attributes = ZAP_ATTRIBUTE_INDEX(747), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3886,7 +3795,7 @@ { \ /* Endpoint: 1, Cluster: Carbon Dioxide Concentration Measurement (server) */ \ .clusterId = 0x0000040D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(775), \ + .attributes = ZAP_ATTRIBUTE_INDEX(760), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3899,7 +3808,7 @@ { \ /* Endpoint: 1, Cluster: Nitrogen Dioxide Concentration Measurement (server) */ \ .clusterId = 0x00000413, \ - .attributes = ZAP_ATTRIBUTE_INDEX(788), \ + .attributes = ZAP_ATTRIBUTE_INDEX(773), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3912,7 +3821,7 @@ { \ /* Endpoint: 1, Cluster: Ozone Concentration Measurement (server) */ \ .clusterId = 0x00000415, \ - .attributes = ZAP_ATTRIBUTE_INDEX(801), \ + .attributes = ZAP_ATTRIBUTE_INDEX(786), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3925,7 +3834,7 @@ { \ /* Endpoint: 1, Cluster: PM2.5 Concentration Measurement (server) */ \ .clusterId = 0x0000042A, \ - .attributes = ZAP_ATTRIBUTE_INDEX(814), \ + .attributes = ZAP_ATTRIBUTE_INDEX(799), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3938,7 +3847,7 @@ { \ /* Endpoint: 1, Cluster: Formaldehyde Concentration Measurement (server) */ \ .clusterId = 0x0000042B, \ - .attributes = ZAP_ATTRIBUTE_INDEX(827), \ + .attributes = ZAP_ATTRIBUTE_INDEX(812), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3951,7 +3860,7 @@ { \ /* Endpoint: 1, Cluster: PM1 Concentration Measurement (server) */ \ .clusterId = 0x0000042C, \ - .attributes = ZAP_ATTRIBUTE_INDEX(840), \ + .attributes = ZAP_ATTRIBUTE_INDEX(825), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3964,7 +3873,7 @@ { \ /* Endpoint: 1, Cluster: PM10 Concentration Measurement (server) */ \ .clusterId = 0x0000042D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(853), \ + .attributes = ZAP_ATTRIBUTE_INDEX(838), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3977,7 +3886,7 @@ { \ /* Endpoint: 1, Cluster: Total Volatile Organic Compounds Concentration Measurement (server) */ \ .clusterId = 0x0000042E, \ - .attributes = ZAP_ATTRIBUTE_INDEX(866), \ + .attributes = ZAP_ATTRIBUTE_INDEX(851), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -3990,7 +3899,7 @@ { \ /* Endpoint: 1, Cluster: Radon Concentration Measurement (server) */ \ .clusterId = 0x0000042F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(879), \ + .attributes = ZAP_ATTRIBUTE_INDEX(864), \ .attributeCount = 13, \ .clusterSize = 2, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4003,7 +3912,7 @@ { \ /* Endpoint: 1, Cluster: Wake on LAN (server) */ \ .clusterId = 0x00000503, \ - .attributes = ZAP_ATTRIBUTE_INDEX(892), \ + .attributes = ZAP_ATTRIBUTE_INDEX(877), \ .attributeCount = 3, \ .clusterSize = 19, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4016,25 +3925,12 @@ { \ /* Endpoint: 1, Cluster: Low Power (server) */ \ .clusterId = 0x00000508, \ - .attributes = ZAP_ATTRIBUTE_INDEX(895), \ + .attributes = ZAP_ATTRIBUTE_INDEX(880), \ .attributeCount = 2, \ .clusterSize = 6, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 267 ), \ - .generatedCommandList = nullptr, \ - .eventList = nullptr, \ - .eventCount = 0, \ - },\ - { \ - /* Endpoint: 1, Cluster: Electrical Measurement (server) */ \ - .clusterId = 0x00000B04, \ - .attributes = ZAP_ATTRIBUTE_INDEX(897), \ - .attributeCount = 13, \ - .clusterSize = 32, \ - .mask = ZAP_CLUSTER_MASK(SERVER), \ - .functions = NULL, \ - .acceptedCommandList = nullptr, \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 264 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -4042,25 +3938,25 @@ { \ /* Endpoint: 1, Cluster: Unit Testing (server) */ \ .clusterId = 0xFFF1FC05, \ - .attributes = ZAP_ATTRIBUTE_INDEX(910), \ + .attributes = ZAP_ATTRIBUTE_INDEX(882), \ .attributeCount = 84, \ .clusterSize = 2290, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 269 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 291 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 266 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 288 ), \ .eventList = ZAP_GENERATED_EVENTS_INDEX( 59 ), \ .eventCount = 3, \ },\ { \ /* Endpoint: 2, Cluster: Identify (server) */ \ .clusterId = 0x00000003, \ - .attributes = ZAP_ATTRIBUTE_INDEX(994), \ + .attributes = ZAP_ATTRIBUTE_INDEX(966), \ .attributeCount = 4, \ .clusterSize = 9, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(ATTRIBUTE_CHANGED_FUNCTION), \ .functions = chipFuncArrayIdentifyServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 303 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 300 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -4068,25 +3964,25 @@ { \ /* Endpoint: 2, Cluster: Groups (server) */ \ .clusterId = 0x00000004, \ - .attributes = ZAP_ATTRIBUTE_INDEX(998), \ + .attributes = ZAP_ATTRIBUTE_INDEX(970), \ .attributeCount = 3, \ .clusterSize = 7, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ .functions = chipFuncArrayGroupsServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 306 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 313 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 303 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 310 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 2, Cluster: On/Off (server) */ \ .clusterId = 0x00000006, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1001), \ + .attributes = ZAP_ATTRIBUTE_INDEX(973), \ .attributeCount = 7, \ .clusterSize = 13, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayOnOffServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 318 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 315 ), \ .generatedCommandList = nullptr, \ .eventList = nullptr, \ .eventCount = 0, \ @@ -4094,7 +3990,7 @@ { \ /* Endpoint: 2, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1008), \ + .attributes = ZAP_ATTRIBUTE_INDEX(980), \ .attributeCount = 7, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4107,7 +4003,7 @@ { \ /* Endpoint: 2, Cluster: Power Source (server) */ \ .clusterId = 0x0000002F, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1015), \ + .attributes = ZAP_ATTRIBUTE_INDEX(987), \ .attributeCount = 9, \ .clusterSize = 72, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4120,20 +4016,20 @@ { \ /* Endpoint: 2, Cluster: Scenes Management (server) */ \ .clusterId = 0x00000062, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1024), \ + .attributes = ZAP_ATTRIBUTE_INDEX(996), \ .attributeCount = 5, \ .clusterSize = 16, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION) | ZAP_CLUSTER_MASK(SHUTDOWN_FUNCTION), \ .functions = chipFuncArrayScenesManagementServer, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 325 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 334 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 322 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 331 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ { \ /* Endpoint: 2, Cluster: Occupancy Sensing (server) */ \ .clusterId = 0x00000406, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1029), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1001), \ .attributeCount = 5, \ .clusterSize = 5, \ .mask = ZAP_CLUSTER_MASK(SERVER) | ZAP_CLUSTER_MASK(INIT_FUNCTION), \ @@ -4146,7 +4042,7 @@ { \ /* Endpoint: 65534, Cluster: Descriptor (server) */ \ .clusterId = 0x0000001D, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1034), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1006), \ .attributeCount = 6, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ @@ -4159,13 +4055,13 @@ { \ /* Endpoint: 65534, Cluster: Network Commissioning (server) */ \ .clusterId = 0x00000031, \ - .attributes = ZAP_ATTRIBUTE_INDEX(1040), \ + .attributes = ZAP_ATTRIBUTE_INDEX(1012), \ .attributeCount = 10, \ .clusterSize = 0, \ .mask = ZAP_CLUSTER_MASK(SERVER), \ .functions = NULL, \ - .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 342 ), \ - .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 349 ), \ + .acceptedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 339 ), \ + .generatedCommandList = ZAP_GENERATED_COMMANDS_INDEX( 346 ), \ .eventList = nullptr, \ .eventCount = 0, \ },\ @@ -4173,13 +4069,13 @@ // clang-format on -#define ZAP_FIXED_ENDPOINT_DATA_VERSION_COUNT 109 +#define ZAP_FIXED_ENDPOINT_DATA_VERSION_COUNT 105 // This is an array of EmberAfEndpointType structures. #define GENERATED_ENDPOINT_TYPES \ { \ - { ZAP_CLUSTER_INDEX(0), 28, 340 }, { ZAP_CLUSTER_INDEX(28), 74, 3517 }, { ZAP_CLUSTER_INDEX(102), 7, 122 }, \ - { ZAP_CLUSTER_INDEX(109), 2, 0 }, \ + { ZAP_CLUSTER_INDEX(0), 28, 340 }, { ZAP_CLUSTER_INDEX(28), 70, 3457 }, { ZAP_CLUSTER_INDEX(98), 7, 122 }, \ + { ZAP_CLUSTER_INDEX(105), 2, 0 }, \ } // Largest attribute size is needed for various buffers @@ -4191,7 +4087,7 @@ static_assert(ATTRIBUTE_LARGEST <= CHIP_CONFIG_MAX_ATTRIBUTE_STORE_ELEMENT_SIZE, #define ATTRIBUTE_SINGLETONS_SIZE (36) // Total size of attribute storage -#define ATTRIBUTE_MAX_SIZE (3979) +#define ATTRIBUTE_MAX_SIZE (3919) // Number of fixed endpoints #define FIXED_ENDPOINT_COUNT (4) diff --git a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h index ccb66133d42412..9c1886588e4529 100644 --- a/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h +++ b/scripts/tools/zap/tests/outputs/all-clusters-app/app-templates/gen_config.h @@ -25,9 +25,7 @@ #define MATTER_DM_GROUPS_CLUSTER_SERVER_ENDPOINT_COUNT (3) #define MATTER_DM_ON_OFF_CLUSTER_CLIENT_ENDPOINT_COUNT (1) #define MATTER_DM_ON_OFF_CLUSTER_SERVER_ENDPOINT_COUNT (2) -#define MATTER_DM_ON_OFF_SWITCH_CONFIGURATION_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define MATTER_DM_LEVEL_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define MATTER_DM_BINARY_INPUT_BASIC_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define MATTER_DM_DESCRIPTOR_CLUSTER_SERVER_ENDPOINT_COUNT (4) #define MATTER_DM_BINDING_CLUSTER_SERVER_ENDPOINT_COUNT (2) #define MATTER_DM_ACCESS_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -88,7 +86,6 @@ #define MATTER_DM_ENERGY_EVSE_MODE_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define MATTER_DM_DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define MATTER_DM_WINDOW_COVERING_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define MATTER_DM_BARRIER_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define MATTER_DM_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define MATTER_DM_THERMOSTAT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define MATTER_DM_FAN_CONTROL_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -113,7 +110,6 @@ #define MATTER_DM_RADON_CONCENTRATION_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define MATTER_DM_WAKE_ON_LAN_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define MATTER_DM_LOW_POWER_CLUSTER_SERVER_ENDPOINT_COUNT (1) -#define MATTER_DM_ELECTRICAL_MEASUREMENT_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define MATTER_DM_UNIT_TESTING_CLUSTER_SERVER_ENDPOINT_COUNT (1) #define MATTER_DM_FAULT_INJECTION_CLUSTER_SERVER_ENDPOINT_COUNT (1) @@ -138,11 +134,6 @@ #define MATTER_DM_PLUGIN_ON_OFF_SERVER #define MATTER_DM_PLUGIN_ON_OFF -// Use this macro to check if the server side of the On/off Switch Configuration cluster is included -#define ZCL_USING_ON_OFF_SWITCH_CONFIGURATION_CLUSTER_SERVER -#define MATTER_DM_PLUGIN_ON_OFF_SWITCH_CONFIGURATION_SERVER -#define MATTER_DM_PLUGIN_ON_OFF_SWITCH_CONFIGURATION - // Use this macro to check if the server side of the Level Control cluster is included #define ZCL_USING_LEVEL_CONTROL_CLUSTER_SERVER #define MATTER_DM_PLUGIN_LEVEL_CONTROL_SERVER @@ -152,11 +143,6 @@ #define MATTER_DM_PLUGIN_LEVEL_CONTROL_MINIMUM_LEVEL 0 #define MATTER_DM_PLUGIN_LEVEL_CONTROL_RATE 0 -// Use this macro to check if the server side of the Binary Input (Basic) cluster is included -#define ZCL_USING_BINARY_INPUT_BASIC_CLUSTER_SERVER -#define MATTER_DM_PLUGIN_BINARY_INPUT_BASIC_SERVER -#define MATTER_DM_PLUGIN_BINARY_INPUT_BASIC - // Use this macro to check if the server side of the Descriptor cluster is included #define ZCL_USING_DESCRIPTOR_CLUSTER_SERVER #define MATTER_DM_PLUGIN_DESCRIPTOR_SERVER @@ -467,11 +453,6 @@ #define MATTER_DM_PLUGIN_WINDOW_COVERING_SERVER #define MATTER_DM_PLUGIN_WINDOW_COVERING -// Use this macro to check if the server side of the Barrier Control cluster is included -#define ZCL_USING_BARRIER_CONTROL_CLUSTER_SERVER -#define MATTER_DM_PLUGIN_BARRIER_CONTROL_SERVER -#define MATTER_DM_PLUGIN_BARRIER_CONTROL - // Use this macro to check if the server side of the Pump Configuration and Control cluster is included #define ZCL_USING_PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_SERVER #define MATTER_DM_PLUGIN_PUMP_CONFIGURATION_AND_CONTROL_SERVER @@ -596,11 +577,6 @@ #define MATTER_DM_PLUGIN_LOW_POWER_SERVER #define MATTER_DM_PLUGIN_LOW_POWER -// Use this macro to check if the server side of the Electrical Measurement cluster is included -#define ZCL_USING_ELECTRICAL_MEASUREMENT_CLUSTER_SERVER -#define MATTER_DM_PLUGIN_ELECTRICAL_MEASUREMENT_SERVER -#define MATTER_DM_PLUGIN_ELECTRICAL_MEASUREMENT - // Use this macro to check if the server side of the Unit Testing cluster is included #define ZCL_USING_UNIT_TESTING_CLUSTER_SERVER #define MATTER_DM_PLUGIN_UNIT_TESTING_SERVER diff --git a/src/app/chip_data_model.gni b/src/app/chip_data_model.gni index c8907ac98b3d79..42b221c1a98836 100644 --- a/src/app/chip_data_model.gni +++ b/src/app/chip_data_model.gni @@ -182,7 +182,6 @@ template("chip_data_model") { } sources += [ - "${_app_root}/clusters/barrier-control-server/barrier-control-server.h", "${_app_root}/clusters/basic-information/basic-information.h", "${_app_root}/clusters/color-control-server/color-control-server.h", "${_app_root}/clusters/door-lock-server/door-lock-server.h", diff --git a/src/app/clusters/barrier-control-server/barrier-control-server.cpp b/src/app/clusters/barrier-control-server/barrier-control-server.cpp deleted file mode 100644 index da7d23e7038933..00000000000000 --- a/src/app/clusters/barrier-control-server/barrier-control-server.cpp +++ /dev/null @@ -1,370 +0,0 @@ -/** - * - * Copyright (c) 2020 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#include "barrier-control-server.h" -#include -#include -#include -#include -#include -#include -#include - -#include - -// We need this for initializating default reporting configurations. -#include - -#include -#include - -using namespace chip; -using namespace chip::app::Clusters; -using namespace chip::app::Clusters::BarrierControl; -using chip::Protocols::InteractionModel::Status; - -// this is NOT in any spec (CHIP spec does not currently have BarrierControl) -// and XMLs do not attach these enums to clusters. -// -// This directly defines some constants. These could be replaced with real -// constants if we ever have some BarrierControl in the matter specification. -namespace chip { -namespace app { -namespace Clusters { -namespace BarrierControl { - -namespace Position { -static constexpr uint8_t kClosed = 0; -static constexpr uint8_t kOpen = 100; -static constexpr uint8_t kUnknown = 255; -} // namespace Position - -namespace MovingState { -static constexpr uint8_t kStopped = 0; -static constexpr uint8_t kClosing = 1; -static constexpr uint8_t kOpening = 2; -} // namespace MovingState - -} // namespace BarrierControl -} // namespace Clusters -} // namespace app -} // namespace chip - -typedef struct -{ - uint8_t currentPosition; - uint8_t targetPosition; - bool increasing; - uint32_t delayMs; -} State; -static State state; - -/********************************************************** - * Matter timer scheduling glue logic - *********************************************************/ - -void emberAfBarrierControlClusterServerTickCallback(EndpointId endpoint); - -static void timerCallback(System::Layer *, void * callbackContext) -{ - emberAfBarrierControlClusterServerTickCallback(static_cast(reinterpret_cast(callbackContext))); -} - -static void scheduleTimerCallbackMs(EndpointId endpoint, uint32_t delayMs) -{ - DeviceLayer::SystemLayer().StartTimer(chip::System::Clock::Milliseconds32(delayMs), timerCallback, - reinterpret_cast(static_cast(endpoint))); -} - -static void cancelEndpointTimerCallback(EndpointId endpoint) -{ - DeviceLayer::SystemLayer().CancelTimer(timerCallback, reinterpret_cast(static_cast(endpoint))); -} - -// ----------------------------------------------------------------------------- -// Accessing attributes - -uint8_t emAfPluginBarrierControlServerGetBarrierPosition(EndpointId endpoint) -{ - uint8_t position; - Status status = Attributes::BarrierPosition::Get(endpoint, &position); - assert(status == Status::Success); - return position; -} - -void emAfPluginBarrierControlServerSetBarrierPosition(EndpointId endpoint, uint8_t position) -{ - Status status = Attributes::BarrierPosition::Set(endpoint, position); - assert(status == Status::Success); -} - -bool emAfPluginBarrierControlServerIsPartialBarrierSupported(EndpointId endpoint) -{ - uint8_t bitmap; - Status status = Attributes::BarrierCapabilities::Get(endpoint, &bitmap); - assert(status == Status::Success); - return (bitmap & to_underlying(BarrierControlCapabilities::kPartialBarrier)) != 0; -} - -static uint16_t getOpenOrClosePeriod(EndpointId endpoint, bool open) -{ - uint16_t period = 0; - Status status = Status::Success; -#if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_OPEN_PERIOD_ATTRIBUTE) - if (open) - { - status = Attributes::BarrierOpenPeriod::Get(endpoint, &period); - } -#endif -#if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_CLOSE_PERIOD_ATTRIBUTE) - if (!open) - { - status = Attributes::BarrierClosePeriod::Get(endpoint, &period); - } -#endif - assert(status == Status::Success); - return period; -} - -static void setMovingState(EndpointId endpoint, uint8_t newState) -{ - Status status = Attributes::BarrierMovingState::Set(endpoint, newState); - assert(status == Status::Success); -} - -uint16_t emAfPluginBarrierControlServerGetSafetyStatus(EndpointId endpoint) -{ - uint16_t safetyStatus; - Status status = Attributes::BarrierSafetyStatus::Get(endpoint, &safetyStatus); - assert(status == Status::Success); - return safetyStatus; -} - -static bool isRemoteLockoutOn(EndpointId endpoint) -{ - uint16_t safetyStatus = emAfPluginBarrierControlServerGetSafetyStatus(endpoint); - return (safetyStatus & to_underlying(BarrierControlSafetyStatus::kRemoteLockout)) != 0; -} - -void emAfPluginBarrierControlServerIncrementEvents(EndpointId endpoint, bool open, bool command) -{ - Status status = Status::Success; - uint16_t events = 0; - -#if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_OPEN_EVENTS_ATTRIBUTE) - if (open && !command) - { - status = Attributes::BarrierOpenEvents::Get(endpoint, &events); - } -#endif -#if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_CLOSE_EVENTS_ATTRIBUTE) - if (!open && !command) - { - status = Attributes::BarrierCloseEvents::Get(endpoint, &events); - } -#endif -#if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_COMMAND_OPEN_EVENTS_ATTRIBUTE) - if (open && command) - { - status = Attributes::BarrierCommandOpenEvents::Get(endpoint, &events); - } -#endif -#if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_COMMAND_CLOSE_EVENTS_ATTRIBUTE) - if (!open && command) - { - status = Attributes::BarrierCommandCloseEvents::Get(endpoint, &events); - } -#endif - assert(status == Status::Success); - - // Section 7.1.2.1.5-8 says that this events counter SHALL NOT roll over. - // The maximum 16-bit unsigned integer in Zigbee is 0xFFFE, so we have this - // check here. - if (events == UINT16_MAX - 1) - { - return; - } - events++; - -#if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_OPEN_EVENTS_ATTRIBUTE) - if (open && !command) - { - status = Attributes::BarrierOpenEvents::Set(endpoint, events); - } -#endif -#if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_CLOSE_EVENTS_ATTRIBUTE) - if (!open && !command) - { - status = Attributes::BarrierCloseEvents::Set(endpoint, events); - } -#endif -#if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_COMMAND_OPEN_EVENTS_ATTRIBUTE) - if (open && command) - { - status = Attributes::BarrierCommandOpenEvents::Set(endpoint, events); - } -#endif -#if defined(ZCL_USING_BARRIER_CONTROL_CLUSTER_BARRIER_COMMAND_CLOSE_EVENTS_ATTRIBUTE) - if (!open && command) - { - status = Attributes::BarrierCommandCloseEvents::Set(endpoint, events); - } -#endif - assert(status == Status::Success); -} - -// ----------------------------------------------------------------------------- -// Opening/closing barrier - -static uint8_t getCurrentPosition(EndpointId endpoint) -{ - // If the BarrierPosition attribute does not store the exact position of the - // barrier, then it will be set to 0xFF. If this is the case, then we have no - // way of knowing the position of the barrier. Let's guess that the barrier is - // open so that we don't leave the barrier open when it should be closed. - uint8_t currentPositionFromAttribute = emAfPluginBarrierControlServerGetBarrierPosition(endpoint); - return ((currentPositionFromAttribute == BarrierControl::Position::kUnknown) ? BarrierControl::Position::kOpen - : currentPositionFromAttribute); -} - -static uint32_t calculateDelayMs(EndpointId endpoint, uint8_t targetPosition, bool * opening) -{ - uint8_t currentPosition = emAfPluginBarrierControlServerGetBarrierPosition(endpoint); - *opening = targetPosition > currentPosition; - uint8_t positionDelta = static_cast(*opening ? targetPosition - currentPosition : currentPosition - targetPosition); - uint16_t openOrClosePeriodDs = getOpenOrClosePeriod(endpoint, *opening); - uint32_t openOrClosePeriodMs = openOrClosePeriodDs * MILLISECOND_TICKS_PER_DECISECOND; - - // We use a minimum delay so that our barrier changes position in a realistic - // amount of time. - if (openOrClosePeriodDs == 0 || positionDelta == 0) - { - return MIN_POSITION_CHANGE_DELAY_MS; - } - - uint32_t delayMs = openOrClosePeriodMs / positionDelta; - return (delayMs < MIN_POSITION_CHANGE_DELAY_MS ? MIN_POSITION_CHANGE_DELAY_MS : delayMs); -} - -void emberAfBarrierControlClusterServerTickCallback(EndpointId endpoint) -{ - if (state.currentPosition == state.targetPosition) - { - emAfPluginBarrierControlServerSetBarrierPosition(endpoint, state.currentPosition); - setMovingState(endpoint, BarrierControl::MovingState::kStopped); - cancelEndpointTimerCallback(endpoint); - } - else - { - if (state.increasing) - { - if (++state.currentPosition == 1) - { - // Zero -> nonzero: open event - emAfPluginBarrierControlServerIncrementEvents(endpoint, true, false); - } - } - else - { - if (--state.currentPosition == 0) - { - // Nonzero -> zero: close event - emAfPluginBarrierControlServerIncrementEvents(endpoint, false, false); - } - } - emAfPluginBarrierControlServerSetBarrierPosition(endpoint, - (emAfPluginBarrierControlServerIsPartialBarrierSupported(endpoint) - ? state.currentPosition - : BarrierControl::Position::kUnknown)); - setMovingState(endpoint, - (state.increasing ? BarrierControl::MovingState::kOpening : BarrierControl::MovingState::kClosing)); - - scheduleTimerCallbackMs(endpoint, state.delayMs); - } -} - -// ----------------------------------------------------------------------------- -// Handling commands - -static void sendDefaultResponse(app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, Status status) -{ - commandObj->AddStatus(commandPath, status); -} - -bool emberAfBarrierControlClusterBarrierControlGoToPercentCallback( - app::CommandHandler * commandObj, const app::ConcreteCommandPath & commandPath, - const Commands::BarrierControlGoToPercent::DecodableType & commandData) -{ - auto & percentOpen = commandData.percentOpen; - - EndpointId endpoint = commandPath.mEndpointId; - Status status = Status::Success; - - ChipLogProgress(Zcl, "RX: GoToPercentCallback p=%d", percentOpen); - - if (isRemoteLockoutOn(endpoint)) - { - status = Status::Failure; - } - else if (percentOpen > 100 // "100" means "100%", so greater than that is invalid - || (!emAfPluginBarrierControlServerIsPartialBarrierSupported(endpoint) && - percentOpen != BarrierControl::Position::kClosed && percentOpen != BarrierControl::Position::kOpen)) - { - status = Status::ConstraintError; - } - else - { - state.currentPosition = getCurrentPosition(endpoint); - state.targetPosition = percentOpen; - state.delayMs = calculateDelayMs(endpoint, state.targetPosition, &state.increasing); - ChipLogProgress(Zcl, "Scheduling barrier move from %d to %d with %" PRIu32 "ms delay", state.currentPosition, - state.targetPosition, state.delayMs); - scheduleTimerCallbackMs(endpoint, state.delayMs); - - if (state.currentPosition < state.targetPosition) - { - emAfPluginBarrierControlServerIncrementEvents(endpoint, true, true); - } - else if (state.currentPosition > state.targetPosition) - { - emAfPluginBarrierControlServerIncrementEvents(endpoint, false, true); - } - } - - sendDefaultResponse(commandObj, commandPath, status); - - return true; -} - -bool emberAfBarrierControlClusterBarrierControlStopCallback(app::CommandHandler * commandObj, - const app::ConcreteCommandPath & commandPath, - const Commands::BarrierControlStop::DecodableType & commandData) -{ - EndpointId endpoint = commandPath.mEndpointId; - cancelEndpointTimerCallback(endpoint); - setMovingState(endpoint, BarrierControl::MovingState::kStopped); - sendDefaultResponse(commandObj, commandPath, Status::Success); - return true; -} - -void MatterBarrierControlPluginServerInitCallback() {} - -void MatterBarrierControlClusterServerShutdownCallback(EndpointId endpoint) -{ - ChipLogProgress(Zcl, "Shuting barrier control server cluster on endpoint %d", endpoint); - cancelEndpointTimerCallback(endpoint); -} diff --git a/src/app/clusters/barrier-control-server/barrier-control-server.h b/src/app/clusters/barrier-control-server/barrier-control-server.h deleted file mode 100644 index 549bbdf30616e6..00000000000000 --- a/src/app/clusters/barrier-control-server/barrier-control-server.h +++ /dev/null @@ -1,53 +0,0 @@ -/** - * - * Copyright (c) 2020 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -#pragma once - -#include -#include - -#include - -#ifndef DOXYGEN_SHOULD_SKIP_THIS -// There are helper getter/setting APIs that are shared between the core -// implementation and the CLI code. They are private to the plugin. - -// This will always either return the current BarrierPosition attribute value -// or assert. -uint8_t emAfPluginBarrierControlServerGetBarrierPosition(chip::EndpointId endpoint); - -// This will always either set the current BarrierPosition attribute value or -// assert. -void emAfPluginBarrierControlServerSetBarrierPosition(chip::EndpointId endpoint, uint8_t barrierPosition); - -// This will either return whether or not the PartialBarrier bit is set in the -// Capabilities attribute value, or it will assert. -bool emAfPluginBarrierControlServerIsPartialBarrierSupported(chip::EndpointId endpoint); - -// This will increment the OpenEvents, CloseEvents, CommandOpenEvents, and -// CommandCloseEvents attribute values depending on which combination of the -// open and command arguments are passed, or assert. -void emAfPluginBarrierControlServerIncrementEvents(chip::EndpointId endpoint, bool open, bool command); - -// This will read the SafetyStatus attribute and return the value, or assert. -uint16_t emAfPluginBarrierControlServerGetSafetyStatus(chip::EndpointId endpoint); - -// We use a minimum delay so that our barrier changes position in a realistic -// amount of time. -#define MIN_POSITION_CHANGE_DELAY_MS 30 - -#endif diff --git a/src/app/tests/suites/README.md b/src/app/tests/suites/README.md index 39236e3b1517d6..e89862ec27cd81 100644 --- a/src/app/tests/suites/README.md +++ b/src/app/tests/suites/README.md @@ -3,25 +3,30 @@ - [CHIP Test Suites](#chip-test-suites) - [Controllers](#controllers) - [Automatic conversion process](#automatic-conversion-process) -- [List](#list) - - [chip_tests](#list-chiptests) - - [Property: test](#property-test) - - [Property: config](#property-config) - - [Property: {variable_name}](#property-variable_name) - - [chip_tests_items](#list-chip_tests_items) - - [Property: tests](#property-tests) - - [Property: arguments](#property-arguments) - - [Property: values](#property-values) - - [Property: response](#property-response) - - [Property: constraints](#property-constraints) - - [chip_tests_item_parameters](#list-chip_tests_item_parameters) - - [chip_tests_item_response_parameters](#list-chip_tests_item_response_parameters) - - [chip_tests_pics](#list-chip_tests_pics) +- [Lists](#lists) + - [List: _chip_tests_](#list-chip_tests) + - [Property: _test_](#property-test) + - [Property: _config_](#property-config) + - [Property: _{variable_name}_](#property-variable_name) + - [List: _chip_tests_items_](#list-chip_tests_items) + - [Property: _tests_](#property-tests) + - [Property: _arguments_](#property-arguments) + - [Property: _values_](#property-values) + - [Property: _response_](#property-response) + - [Property: _constraints_](#property-constraints) + - [List: _chip_tests_item_parameters_](#list-chip_tests_item_parameters) + - [List: _chip_tests_item_response_parameters_](#list-chip_tests_item_response_parameters) + - [List: _chip_tests_pics_](#list-chip_tests_pics) + - [List: _chip_tests_config_](#list-chip_tests_config) - [YAML Test Definition](#yaml-test-definition) -- [PICS Usage](#pics-usage) + - [Location of Test Definitions](#location-of-test-definitions) +- [PICS Usage](#pics-usage) - [Required Files](#required-files) - + [Example PICS Command](#example-pics-command) - [Examples](#examples) - [YAML Examples](#yaml-examples) - [ZAP Example](#zap-example) + - [Required Files](#required-files-1) + - [Generate Example Script](#generate-example-script) - [Index](#index) This directory contains a set of tests describing interactions between nodes, @@ -375,48 +380,3 @@ src/app/tests/suites/examples/gen_readme_example.sh | unknown | 0 | UNKNOWN | 0xFF | Unknown | uint8_t \* | - -
Cluster Names

- -| | | | -| ------------------------------ | ---------------------------------------- | --------------------------------------------- | -| PowerConfiguration | AdministratorCommissioning | DissolvedOxygenConcentrationMeasurement | -| DeviceTemperatureConfiguration | OperationalCredentials | BromateConcentrationMeasurement | -| Identify | GroupKeyManagement | ChloraminesConcentrationMeasurement | -| Groups | FixedLabel | ChlorineConcentrationMeasurement | -| Scenes | UserLabel | FecalColiformAndEColiConcentrationMeasurement | -| OnOff | ProxyConfiguration | FluorideConcentrationMeasurement | -| OnOffSwitchConfiguration | ProxyDiscovery | HaloaceticAcidsConcentrationMeasurement | -| LevelControl | ProxyValid | TotalTrihalomethanesConcentrationMeasurement | -| Alarms | BooleanState | TotalColiformBacteriaConcentrationMeasurement | -| Time | ModeSelect | TurbidityConcentrationMeasurement | -| BinaryInputBasic | ShadeConfiguration | CopperConcentrationMeasurement | -| PowerProfile | DoorLock | LeadConcentrationMeasurement | -| ApplianceControl | WindowCovering | ManganeseConcentrationMeasurement | -| PulseWidthModulation | BarrierControl | SulfateConcentrationMeasurement | -| Descriptor | PumpConfigurationAndControl | BromodichloromethaneConcentrationMeasurement | -| Binding | Thermostat | BromoformConcentrationMeasurement | -| AccessControl | FanControl | ChlorodibromomethaneConcentrationMeasurement | -| PollControl | DehumidificationControl | ChloroformConcentrationMeasurement | -| Actions | ThermostatUserInterfaceConfiguration | SodiumConcentrationMeasurement | -| Basic | ColorControl | IasZone | -| OtaSoftwareUpdateProvider | BallastConfiguration | IasAce | -| OtaSoftwareUpdateRequestor | IlluminanceMeasurement | IasWd | -| LocalizationConfiguration | TemperatureMeasurement | WakeOnLan | -| TimeFormatLocalization | PressureMeasurement | Channel | -| UnitLocalization | FlowMeasurement | TargetNavigator | -| PowerSourceConfiguration | RelativeHumidityMeasurement | MediaPlayback | -| PowerSource | OccupancySensing | MediaInput | -| GeneralCommissioning | CarbonMonoxideConcentrationMeasurement | LowPower | -| NetworkCommissioning | CarbonDioxideConcentrationMeasurement | KeypadInput | -| DiagnosticLogs | EthyleneConcentrationMeasurement | ContentLauncher | -| GeneralDiagnostics | EthyleneOxideConcentrationMeasurement | AudioOutput | -| SoftwareDiagnostics | HydrogenConcentrationMeasurement | ApplicationLauncher | -| ThreadNetworkDiagnostics | HydrogenSulphideConcentrationMeasurement | ApplicationBasic | -| WiFiNetworkDiagnostics | NitricOxideConcentrationMeasurement | AccountLogin | -| EthernetNetworkDiagnostics | NitrogenDioxideConcentrationMeasurement | TestCluster | -| TimeSynchronization | OxygenConcentrationMeasurement | Messaging | -| BridgedDeviceBasicInformation | OzoneConcentrationMeasurement | ApplianceIdentification | -| Switch | SulfurDioxideConcentrationMeasurement | MeterIdentification | - -

diff --git a/src/app/tests/suites/certification/information.py b/src/app/tests/suites/certification/information.py deleted file mode 100755 index bf5bbaa418bd30..00000000000000 --- a/src/app/tests/suites/certification/information.py +++ /dev/null @@ -1,175 +0,0 @@ -#!/usr/bin/env python3 -# -# Copyright (c) 2021 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -# - -import argparse -import sys -from enum import Enum -from os import listdir, path - -import yaml - -# Test status description: -# * Missing: Tests has not been written yet (default) -# * Pending: Tests are not running in CI, and all tests are disabled -# * Partial: Tests are running in CI, but some tests are disabled -# * Complete: Tests are running in CI - - -class TestStatus(Enum): - missing = 1 - pending = 2 - partial = 3 - complete = 4 - - -class ArgOptions(Enum): - summary = 1 - unknown = 2 - missing = 3 - pending = 4 - partial = 5 - complete = 6 - - -def checkPythonVersion(): - if sys.version_info[0] < 3: - print('Must use Python 3. Current version is ' + - str(sys.version_info[0])) - exit(1) - - -def parseTestPlans(filepath): - tests_names = [] - tests_statuses = [] - - for name, test_plan in parseYaml(filepath)['Test Plans'].items(): - for section, tests in test_plan['tests'].items(): - for index, test in enumerate(tests): - test_name = '_'.join([ - 'Test_TC', - test_plan['shortname'], - str(section), - str(index + 1) - ]) - - tests_names.append(test_name) - tests_statuses.append(parseTestPlan(getPathFor(test_name))) - - return dict(zip(tests_names, tests_statuses)) - - -def parseTestPlan(filepath): - if not path.exists(filepath): - return TestStatus.missing - - is_pending_test = True - - for test_definition in parseYaml(filepath)['tests']: - if 'disabled' in test_definition: - if is_pending_test is False: - return TestStatus.partial - else: - is_pending_test = False - - if is_pending_test is True: - return TestStatus.pending - - return TestStatus.complete - - -def parseYaml(filepath): - with open(filepath) as file: - return yaml.load(file, Loader=yaml.FullLoader) - - -def getPathFor(filename): - return path.join(path.dirname(__file__), filename + '.yaml') - - -def printSummaryFor(name, summary): - count = summary[name] - total = summary['total'] - percent = round(count/total*100, 2) - print(' * ' + name.ljust(10) + ': ' + str(count).rjust(3) + - ' (' + str(percent).rjust(5) + '%)') - - -def printSummary(statuses): - summary = { - 'total': len(statuses), - 'missings': sum(TestStatus.missing == status for status in statuses.values()), - 'pendings': sum(TestStatus.pending == status for status in statuses.values()), - 'partials': sum(TestStatus.partial == status for status in statuses.values()), - 'completes': sum(TestStatus.complete == status for status in statuses.values()), - } - - print('Tests count: ', summary['total']) - printSummaryFor('missings', summary) - printSummaryFor('pendings', summary) - printSummaryFor('partials', summary) - printSummaryFor('completes', summary) - - -def printUnknown(statuses): - filtered = list(filter(lambda name: name.startswith( - 'Test_TC_'), listdir(path.dirname(__file__)))) - dir_test_names = [path.splitext(name)[0] for name in filtered] - - known_test_names = [name for name in statuses] - unknown_test_names = list( - filter(lambda name: name not in known_test_names, dir_test_names)) - - print('List of tests that are not part of the test plan:') - for name in unknown_test_names: - print(' *', name) - - -def printList(statuses, name): - filtered = dict( - filter(lambda item: TestStatus[name] == item[1], statuses.items())) - - print('List of tests with status:', name) - for name in filtered: - print(' *', name) - - -def main(): - checkPythonVersion() - - default_options = ArgOptions.summary.name - default_choices = [name for name in ArgOptions.__members__] - - parser = argparse.ArgumentParser( - description='Extract information from the set of certifications tests') - parser.add_argument('-s', '--show', default=default_options, choices=default_choices, - help='The information that needs to be returned from the test set') - args = parser.parse_args() - - statuses = parseTestPlans(getPathFor('tests')) - - if (ArgOptions.summary.name == args.show): - printSummary(statuses) - elif (ArgOptions.unknown.name == args.show): - printUnknown(statuses) - elif (args.show in ArgOptions.__members__): - printList(statuses, args.show) - else: - parser.print_help() - - -if __name__ == '__main__': - main() diff --git a/src/app/tests/suites/certification/tests.yaml b/src/app/tests/suites/certification/tests.yaml deleted file mode 100644 index 738b7be6619df1..00000000000000 --- a/src/app/tests/suites/certification/tests.yaml +++ /dev/null @@ -1,300 +0,0 @@ -# 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: Certification Tests - -Test Plans: - Bridge: - shortname: BR - tests: - 1: - - name: Basics of Bridging - 2: - - name: Changing the set of Bridged Devices - 3: - - name: Changing names - - Secure Channel: - shortname: SC - tests: - 1: - - name: MRP Retransmission Messaging - - name: MRP MAX Message Size - - name: MRP Message Flows - - name: MRP max number of failed attempts verification - - name: MRP message counter and duplicate messaging verification - 2: - - name: PASE Session Establishment - - name: PASE Bidirectional Connection Session Establishment - 3: - - name: CASE Session Establishment - - name: CASE Session Resumption - 4: - - name: Commissionable Node Discovery - Commissionee Case - - name: Commissionable Node Discovery - Commissioner Case - - name: Operational Discovery - Node - - name: Operational Discovery - Controller - - name: Operational Discovery - Thread Node - - name: Operational Discovery - Thread Controller - - name: Commissioner Discovery - Commissioner - - name: Commissioner Discovery - Commissionee - - Interaction Data Model: - shortname: IDM - tests: - 1: - - name: Invoke Request Action to DUT - - name: Invoke Response Action from DUT - 2: - - name: ReadRequestMessage to DUT test cases - - Multiple Administrators: - shortname: MA - tests: - 1: - - name: Administrator Behavior - - name: Node Behavior - - name: Commissioning window handling (negative test) - - Device Discovery: - shortname: DD - tests: - 1: - - name: QR Code Onboarding Payload Verification - - name: Manual Pairing Code Payload Verification - - name: NFC Onboarding Payload Verification - - name: Concatenation - QR Code Onboarding Payload Verification - - name: NFC Rules of advertisement and Onboarding - - name: QR Code Format and Label - - name: Setup Code Format and Label - - name: - QR Code Onboarding Payload Verification [DUT - Controller] - - name: - Manual Pairing Code Payload Verification [DUT - - Controller] - - name: NFC Onboarding Payload Verification [DUT - Controller] - - name: - Concatenation - QR Code Onboarding Payload Verification - [DUT - Controller] - 2: - - name: Announcement by device verification - - name: Discovery by commissioner verification - 3: - - name: Commissioning Flow - Concurrent - - name: Commissioning Flow - Non-concurrent - - name: User Directed Commissioning - Commissionee - - name: User Directed Commissioning - Commissioner - 4: - - name: Operational Certificate Authority Verification - - Device Management: - shortname: DM - tests: - 1: - - name: Basic Cluster Server Attributes - - name: Basic Cluster Events - - name: Basic Cluster Server Attributes [DUT - Controller] - 2: - - name: Operational Credential Commands - - name: Operational Credential Attributes - 3: - - name: Network Commissioning Attributes - - name: Network Commissioning Commands - - name: Network Commissioning Commands [DUT - Controller] - - Binary Input: - shortname: BI - tests: - 1: - - name: Global attributes with server as DUT - 2: - - name: Attributes with server as DUT - - name: Primary functionality with server as DUT - - Color Control: - shortname: CC - tests: - 1: - - name: Global attributes with server as DUT - 2: - - name: Attributes with server as DUT - 3: - - name: Hue MoveTo functionality with server as DUT - - name: Hue Move functionality with server as DUT - - name: Hue Step functionality with server as DUT - 4: - - name: Saturation MoveTo functionality with server as DUT - - name: Saturation Move functionality with server as DUT - - name: Saturation Step functionality with server as DUT - - name: MoveToHueAndSaturation functionality with server as DUT - 5: - - name: Color MoveTo functionality with server as DUT - - name: Color Move functionality with server as DUT - - name: Color Step functionality with server as DUT - 6: - - name: - Color Temporature MoveTo functionality with server as DUT - - name: Color Temporature Move functionality with server as DUT - - name: Color Temporature Step functionality with server as DUT - 7: - - name: Enhanced MoveTo functionality with server as DUT - - name: Enhanced Move functionality with server as DUT - - name: Enhanced Step functionality with server as DUT - - name: - MoveToEnhancedHueAndSaturation functionality with server - as DUT - 8: - - name: Stop Move Step functionality with server as DUT - - Electrical Measurement: - shortname: EMR - tests: - 1: - - name: Global attributes with server as DUT - 2: - - name: Attributes with server as DUT - - name: Primary functionality with server as DUT - - Flow Measurement: - shortname: FLW - tests: - 1: - - name: Global attributes with server as DUT - 2: - - name: Attributes with server as DUT - - name: Primary functionality with server as DUT - - Level Control: - shortname: LVL - tests: - 1: - - name: Global attributes with server as DUT - 2: - - name: MoveToLevel Verification (DUT as Server) - 3: - - name: Move Verification (DUT as Server) - 4: - - name: Step Verification (DUT as Server) - 5: - - name: Stop Verification (DUT as Server) - - Media Control: - shortname: MC - tests: - 1: - - name: Global attributes with server as DUT - 2: - - name: Low Power Mode Verification (DUT as Server) - 3: - - name: Navigation Keycode Verification - - name: Location Keys Verification - - name: Number Keys Verification - - name: Press And Hold Key Press Verification - - name: Catalog List Verification - - name: Current App Verification - - name: Launch Application Verification - - name: Input List Verification - - name: Select Input Verification - - name: Show and Hide Input Status Verification - - name: Rename Input Verification - 4: - - name: Wake-On LAN Verification - 5: - - name: List TV Channels Verification - - name: Change Channel by Number Verification - - name: Skip Channel Verification - - Occupancy Sensing: - shortname: OCC - tests: - 1: - - name: Global attributes with server as DUT - 2: - - name: Attributes with server as DUT - - OnOff: - shortname: OO - tests: - 1: - - name: Global attributes with server as DUT - 2: - - name: Attributes with server as DUT - - name: Primary functionality with server as DUT - - name: Secondary functionality with server as DUT - - Pressure Measurement: - shortname: PRS - tests: - 1: - - name: Global attributes with server as DUT - 2: - - name: Attributes with server as DUT - - Pump Configuration Control: - shortname: PCC - tests: - 1: - - name: Global attributes with server as DUT - 2: - - name: Attributes with server as DUT - - Relative Humidity Measurement: - shortname: RH - tests: - 1: - - name: Global attributes with server as DUT - 2: - - name: Attributes with server as DUT - - name: Primary functionality with server as DUT - - Temperature Measurement: - shortname: TM - tests: - 1: - - name: Global attributes with server as DUT - 2: - - name: Attributes with server as DUT - - name: Primary functionality with server as DUT - - Window Covering: - shortname: WNCV - tests: - 1: - - name: Global attributes with server as DUT - 2: - - name: Attributes with server as DUT - - name: ConfigStatus Attribute with server as DUT - - name: Mode Attribute with server as DUT - - name: Type Attribute with server as DUT - - name: EndProductType Attribute with server as DUT - 3: - - name: - UpOrOpen Command & Report Verification with server as DUT - - name: - DownOrClose Command & Report Verification with server as - DUT - - name: StopMotion Verification with server as DUT - - name: UpOrOpen Long-Run Verification with server as DUT - - name: DownOrClose Long-Run Verification with server as DUT - 4: - - name: - GoToLiftPercentage Long-Run Verification with server as - DUT - - name: - GoToTiltPercentage Long-Run Verification with server as - DUT - - name: - GoToLiftPercentage Limits Verification with server as DUT - - name: - GoToTiltPercentage Limits Verification with server as DUT diff --git a/src/app/util/util.cpp b/src/app/util/util.cpp index 763e198f41fded..3072e8aafd2a7f 100644 --- a/src/app/util/util.cpp +++ b/src/app/util/util.cpp @@ -88,14 +88,12 @@ void emberAfInit() // them in. void MatterBallastConfigurationPluginServerInitCallback() {} void MatterBooleanStatePluginServerInitCallback() {} -void MatterElectricalMeasurementPluginServerInitCallback() {} void MatterRelativeHumidityMeasurementPluginServerInitCallback() {} void MatterIlluminanceMeasurementPluginServerInitCallback() {} void MatterBinaryInputBasicPluginServerInitCallback() {} void MatterPressureMeasurementPluginServerInitCallback() {} void MatterTemperatureMeasurementPluginServerInitCallback() {} void MatterFlowMeasurementPluginServerInitCallback() {} -void MatterOnOffSwitchConfigurationPluginServerInitCallback() {} void MatterThermostatUserInterfaceConfigurationPluginServerInitCallback() {} void MatterBridgedDeviceBasicInformationPluginServerInitCallback() {} void MatterPowerConfigurationPluginServerInitCallback() {} diff --git a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml index 93d6016ae48b59..386ba20c6d6982 100644 --- a/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml +++ b/src/app/zap-templates/zcl/data-model/chip/matter-devices.xml @@ -2475,10 +2475,6 @@ limitations under the License. BINDING - - BarrierControlGoToPercent - BarrierControlStop - COLOR_CONTROL_CURRENT_HUE COLOR_CONTROL_CURRENT_SATURATION diff --git a/src/app/zap-templates/zcl/data-model/draft/README.md b/src/app/zap-templates/zcl/data-model/draft/README.md deleted file mode 100644 index 06d7e77df709e3..00000000000000 --- a/src/app/zap-templates/zcl/data-model/draft/README.md +++ /dev/null @@ -1,8 +0,0 @@ -# Data Model Draft - -### What is this repo? - -This directory contains clusters and types that have not been specified yet. - -**IMPORTANT**: Adding a cluster code to the types in this folder will expose -them as if they are fully specified. diff --git a/src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml b/src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml deleted file mode 100644 index 282cb205020935..00000000000000 --- a/src/app/zap-templates/zcl/data-model/draft/barrier-control-cluster.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - Barrier Control - Closures - 0x0103 - BARRIER_CONTROL_CLUSTER - This cluster provides control of a barrier (garage door). - - true - true - - barrier moving state - barrier safety status - barrier capabilities - barrier open events - barrier close events - barrier command open events - barrier command close events - barrier open period - barrier close period - barrier position - - - - Command to instruct a barrier to go to a percent open state. - - - - - - - Command that instructs the barrier to stop moving. - - - - - diff --git a/src/app/zap-templates/zcl/data-model/draft/electrical-measurement-cluster.xml b/src/app/zap-templates/zcl/data-model/draft/electrical-measurement-cluster.xml deleted file mode 100644 index e9246a1e3ff84d..00000000000000 --- a/src/app/zap-templates/zcl/data-model/draft/electrical-measurement-cluster.xml +++ /dev/null @@ -1,202 +0,0 @@ - - - - - - - - Electrical Measurement - Home Automation - Attributes related to the electrical properties of a device. This cluster is used by power outlets and other devices that need to provide instantaneous data as opposed to metrology data which should be retrieved from the metering cluster.. - 0x0B04 - ELECTRICAL_MEASUREMENT_CLUSTER - - true - true - - - - measurement type - dc voltage - dc voltage min - dc voltage max - dc current - dc current min - dc current max - dc power - dc power min - dc power max - dc voltage multiplier - dc voltage divisor - dc current multiplier - dc current divisor - dc power multiplier - dc power divisor - ac frequency - ac frequency min - ac frequency max - neutral current - total active power - total reactive power - total apparent power - measured 1st harmonic current - measured 3rd harmonic current - measured 5th harmonic current - measured 7th harmonic current - measured 9th harmonic current - measured 11th harmonic current - measured phase 1st harmonic current - measured phase 3rd harmonic current - measured phase 5th harmonic current - measured phase 7th harmonic current - measured phase 9th harmonic current - measured phase 11th harmonic current - ac frequency multiplier - ac frequency divisor - power multiplier - power divisor - harmonic current multiplier - phase harmonic current multiplier - instantaneous voltage - instantaneous line current - instantaneous active current - instantaneous reactive current - instantaneous power - rms voltage - rms voltage min - rms voltage max - rms current - rms current min - rms current max - active power - active power min - active power max - reactive power - apparent power - power factor - average rms voltage measurement period - average rms under voltage counter - rms extreme over voltage period - rms extreme under voltage period - rms voltage sag period - rms voltage swell period - ac voltage multiplier - ac voltage divisor - ac current multiplier - ac current divisor - ac power multiplier - ac power divisor - overload alarms mask - voltage overload - current overload - ac overload alarms mask - ac voltage overload - ac current overload - ac active power overload - ac reactive power overload - average rms over voltage - average rms under voltage - rms extreme over voltage - rms extreme under voltage - rms voltage sag - rms voltage swell - line current phase b - active current phase b - reactive current phase b - rms voltage phase b - rms voltage min phase b - rms voltage max phase b - rms current phase b - rms current min phase b - rms current max phase b - active power phase b - active power min phase b - active power max phase b - reactive power phase b - apparent power phase b - power factor phase b - average rms voltage measurement period phase b - average rms over voltage counter phase b - average rms under voltage counter phase b - rms extreme over voltage period phase b - rms extreme under voltage period phase b - rms voltage sag period phase b - rms voltage swell period phase b - line current phase c - active current phase c - reactive current phase c - rms voltage phase c - rms voltage min phase c - rms voltage max phase c - rms current phase c - rms current min phase c - rms current max phase c - active power phase c - active power min phase c - active power max phase c - reactive power phase c - apparent power phase c - power factor phase c - average rms voltage measurement period phase c - average rms over voltage counter phase c - average rms under voltage counter phase c - rms extreme over voltage period phase c - rms extreme under voltage period phase c - rms voltage sag period phase c - rms voltage swell period phase c - - - - A function which returns the power profiling information requested in the GetProfileInfo command. The power profiling information consists of a list of attributes which are profiled along with the period used to profile them. - - - - - - - - - - A function which returns the electricity measurement profile. The electricity measurement profile includes information regarding the amount of time used to capture data related to the flow of electricity as well as the intervals thes - - - - - - - - - - - - A function which retrieves the power profiling information from the electrical measurement server. - - - - - - A function which retrieves an electricity measurement profile from the electricity measurement server for a specific attribute Id requested. - - - - - - - diff --git a/src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters.xml b/src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters.xml deleted file mode 100644 index 132de384def242..00000000000000 --- a/src/app/zap-templates/zcl/data-model/draft/input-output-value-clusters.xml +++ /dev/null @@ -1,41 +0,0 @@ - - - - - - - - Binary Input (Basic) - General - An interface for reading the value of a binary measurement and accessing various characteristics of that measurement. - 0x000F - BINARY_INPUT_BASIC_CLUSTER - - true - true - - active text - description - inactive text - out of service - polarity - present value - reliability - status flags - application type - - diff --git a/src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml b/src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml deleted file mode 100644 index eb74be7c600b06..00000000000000 --- a/src/app/zap-templates/zcl/data-model/draft/onoff-switch-configuration-cluster.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - - - - - On/off Switch Configuration - General - Attributes and commands for configuring On/Off switching devices. - 0x0007 - ON_OFF_SWITCH_CONFIGURATION_CLUSTER - - true - true - - switch type - switch actions - - diff --git a/src/app/zap-templates/zcl/zcl-with-test-extensions.json b/src/app/zap-templates/zcl/zcl-with-test-extensions.json index 46f78a177874f6..bc1a29c4b4aa3b 100644 --- a/src/app/zap-templates/zcl/zcl-with-test-extensions.json +++ b/src/app/zap-templates/zcl/zcl-with-test-extensions.json @@ -6,7 +6,6 @@ "xmlRoot": [ ".", "./data-model/chip/", - "./data-model/draft/", "./data-model/silabs/", "./data-model/test" ], @@ -22,7 +21,6 @@ "application-launcher-cluster.xml", "audio-output-cluster.xml", "ballast-configuration-cluster.xml", - "barrier-control-cluster.xml", "basic-information-cluster.xml", "binding-cluster.xml", "boolean-state-cluster.xml", @@ -51,7 +49,6 @@ "ecosystem-information-cluster.xml", "energy-preference-cluster.xml", "electrical-energy-measurement-cluster.xml", - "electrical-measurement-cluster.xml", "electrical-power-measurement-cluster.xml", "energy-evse-cluster.xml", "energy-evse-mode-cluster.xml", @@ -71,7 +68,6 @@ "icd-management-cluster.xml", "identify-cluster.xml", "illuminance-measurement-cluster.xml", - "input-output-value-clusters.xml", "keypad-input-cluster.xml", "laundry-washer-mode-cluster.xml", "laundry-dryer-controls-cluster.xml", @@ -89,7 +85,6 @@ "network-commissioning-cluster.xml", "occupancy-sensing-cluster.xml", "onoff-cluster.xml", - "onoff-switch-configuration-cluster.xml", "operational-credentials-cluster.xml", "operational-state-cluster.xml", "operational-state-oven-cluster.xml", diff --git a/src/app/zap-templates/zcl/zcl.json b/src/app/zap-templates/zcl/zcl.json index de81dc8ba31c99..db4526e39cbbde 100644 --- a/src/app/zap-templates/zcl/zcl.json +++ b/src/app/zap-templates/zcl/zcl.json @@ -3,12 +3,7 @@ "category": "matter", "version": 1, "requiredFeatureLevel": 102, - "xmlRoot": [ - ".", - "./data-model/chip/", - "./data-model/draft/", - "./data-model/silabs/" - ], + "xmlRoot": [".", "./data-model/chip/", "./data-model/silabs/"], "_comment": "Ensure access-control-definitions.xml is first in xmlFile array", "xmlFile": [ "access-control-definitions.xml", @@ -21,7 +16,6 @@ "application-launcher-cluster.xml", "audio-output-cluster.xml", "ballast-configuration-cluster.xml", - "barrier-control-cluster.xml", "basic-information-cluster.xml", "binding-cluster.xml", "boolean-state-cluster.xml", @@ -48,7 +42,6 @@ "drlc-cluster.xml", "ecosystem-information-cluster.xml", "electrical-energy-measurement-cluster.xml", - "electrical-measurement-cluster.xml", "electrical-power-measurement-cluster.xml", "energy-evse-cluster.xml", "energy-evse-mode-cluster.xml", @@ -69,7 +62,6 @@ "icd-management-cluster.xml", "identify-cluster.xml", "illuminance-measurement-cluster.xml", - "input-output-value-clusters.xml", "keypad-input-cluster.xml", "laundry-washer-mode-cluster.xml", "laundry-dryer-controls-cluster.xml", @@ -86,7 +78,6 @@ "network-commissioning-cluster.xml", "occupancy-sensing-cluster.xml", "onoff-cluster.xml", - "onoff-switch-configuration-cluster.xml", "operational-credentials-cluster.xml", "operational-state-cluster.xml", "operational-state-oven-cluster.xml", diff --git a/src/app/zap_cluster_list.json b/src/app/zap_cluster_list.json index e5f0ea9e2e892a..a047340147ece5 100644 --- a/src/app/zap_cluster_list.json +++ b/src/app/zap_cluster_list.json @@ -11,9 +11,7 @@ "APPLICATION_LAUNCHER_CLUSTER": [], "AUDIO_OUTPUT_CLUSTER": [], "BALLAST_CONFIGURATION_CLUSTER": [], - "BARRIER_CONTROL_CLUSTER": [], "BASIC_INFORMATION_CLUSTER": [], - "BINARY_INPUT_BASIC_CLUSTER": [], "BINDING_CLUSTER": [], "BOOLEAN_STATE_CLUSTER": [], "BOOLEAN_STATE_CONFIGURATION_CLUSTER": [], @@ -39,7 +37,6 @@ "DOOR_LOCK_CLUSTER": [], "ECOSYSTEM_INFORMATION_CLUSTER": [], "ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER": [], - "ELECTRICAL_MEASUREMENT_CLUSTER": [], "ELECTRICAL_POWER_MEASUREMENT_CLUSTER": [], "ENERGY_EVSE_CLUSTER": [], "ENERGY_EVSE_MODE_CLUSTER": [], @@ -55,7 +52,6 @@ "GROUP_KEY_MANAGEMENT_CLUSTER": [], "GROUPS_CLUSTER": [], "HEPA_FILTER_MONITORING_CLUSTER": [], - "IAS_ZONE_CLUSTER": [], "ICD_MANAGEMENT_CLUSTER": [], "IDENTIFY_CLUSTER": [], "ILLUMINANCE_MEASUREMENT_CLUSTER": [], @@ -74,7 +70,6 @@ "NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER": [], "OCCUPANCY_SENSING_CLUSTER": [], "ON_OFF_CLUSTER": [], - "ON_OFF_SWITCH_CONFIGURATION_CLUSTER": [], "OPERATIONAL_CREDENTIALS_CLUSTER": [], "OPERATIONAL_STATE_CLUSTER": [], "OPERATIONAL_STATE_OVEN_CLUSTER": [], @@ -136,8 +131,7 @@ "WATER_HEATER_MANAGEMENT_CLUSTER": [], "WATER_HEATER_MODE_CLUSTER": [], "WIFI_NETWORK_DIAGNOSTICS_CLUSTER": [], - "WINDOW_COVERING_CLUSTER": [], - "ZLL_COMMISSIONING_CLUSTER": [] + "WINDOW_COVERING_CLUSTER": [] }, "ServerDirectories": { "ACCESS_CONTROL_CLUSTER": ["access-control-server"], @@ -155,9 +149,7 @@ "APPLICATION_LAUNCHER_CLUSTER": ["application-launcher-server"], "AUDIO_OUTPUT_CLUSTER": ["audio-output-server"], "BALLAST_CONFIGURATION_CLUSTER": [], - "BARRIER_CONTROL_CLUSTER": ["barrier-control-server"], "BASIC_INFORMATION_CLUSTER": ["basic-information"], - "BINARY_INPUT_BASIC_CLUSTER": [], "BINDING_CLUSTER": ["bindings"], "BOOLEAN_STATE_CLUSTER": [], "BOOLEAN_STATE_CONFIGURATION_CLUSTER": [ @@ -192,7 +184,6 @@ "ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER": [ "electrical-energy-measurement-server" ], - "ELECTRICAL_MEASUREMENT_CLUSTER": [], "ELECTRICAL_POWER_MEASUREMENT_CLUSTER": [ "electrical-power-measurement-server" ], @@ -214,7 +205,6 @@ "GROUPS_CLUSTER": ["groups-server"], "HEPA_FILTER_MONITORING_CLUSTER": ["resource-monitoring-server"], "GROUP_KEY_MANAGEMENT_CLUSTER": ["group-key-mgmt-server"], - "IAS_ZONE_CLUSTER": [], "ICD_MANAGEMENT_CLUSTER": ["icd-management-server"], "IDENTIFY_CLUSTER": ["identify-server"], "ILLUMINANCE_MEASUREMENT_CLUSTER": [], @@ -238,7 +228,6 @@ "OCCUPANCY_SENSING_CLUSTER": ["occupancy-sensor-server"], "ON_OFF_CLUSTER": ["on-off-server"], "POWER_TOPOLOGY_CLUSTER": ["power-topology-server"], - "ON_OFF_SWITCH_CONFIGURATION_CLUSTER": [], "OPERATIONAL_CREDENTIALS_CLUSTER": ["operational-credentials-server"], "OPERATIONAL_STATE_CLUSTER": ["operational-state-server"], "OPERATIONAL_STATE_OVEN_CLUSTER": ["operational-state-server"], @@ -323,7 +312,6 @@ "WIFI_NETWORK_MANAGEMENT_CLUSTER": ["wifi-network-management-server"], "WINDOW_COVERING_CLUSTER": ["window-covering-server"], "WATER_HEATER_MANAGEMENT_CLUSTER": ["water-heater-management-server"], - "WATER_HEATER_MODE_CLUSTER": ["mode-base-server"], - "ZLL_COMMISSIONING_CLUSTER": [] + "WATER_HEATER_MODE_CLUSTER": ["mode-base-server"] } } diff --git a/src/controller/data_model/controller-clusters.matter b/src/controller/data_model/controller-clusters.matter index 0a2a04ee0e420c..1ba56719ab4549 100644 --- a/src/controller/data_model/controller-clusters.matter +++ b/src/controller/data_model/controller-clusters.matter @@ -433,20 +433,6 @@ cluster OnOff = 6 { command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; } -/** Attributes and commands for configuring On/Off switching devices. */ -deprecated cluster OnOffSwitchConfiguration = 7 { - revision 1; // NOTE: Default/not specifically set - - readonly attribute enum8 switchType = 0; - attribute enum8 switchActions = 16; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** Attributes and commands for controlling devices that can be set to a level between fully 'On' and fully 'Off.' */ cluster LevelControl = 8 { revision 6; @@ -572,27 +558,6 @@ cluster LevelControl = 8 { command MoveToClosestFrequency(MoveToClosestFrequencyRequest): DefaultSuccess = 8; } -/** An interface for reading the value of a binary measurement and accessing various characteristics of that measurement. */ -deprecated cluster BinaryInputBasic = 15 { - revision 1; // NOTE: Default/not specifically set - - attribute optional char_string<16> activeText = 4; - attribute optional char_string<16> description = 28; - attribute optional char_string<16> inactiveText = 46; - attribute boolean outOfService = 81; - readonly attribute optional enum8 polarity = 84; - attribute boolean presentValue = 85; - attribute optional enum8 reliability = 103; - readonly attribute bitmap8 statusFlags = 111; - readonly attribute optional int32u applicationType = 256; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; -} - /** Cluster to control pulse width modulation */ deprecated cluster PulseWidthModulation = 28 { revision 1; // NOTE: Default/not specifically set @@ -6512,48 +6477,6 @@ cluster WindowCovering = 258 { command GoToTiltPercentage(GoToTiltPercentageRequest): DefaultSuccess = 8; } -/** This cluster provides control of a barrier (garage door). */ -deprecated cluster BarrierControl = 259 { - revision 1; // NOTE: Default/not specifically set - - bitmap BarrierControlCapabilities : bitmap8 { - kPartialBarrier = 0x1; - } - - bitmap BarrierControlSafetyStatus : bitmap16 { - kRemoteLockout = 0x1; - kTemperDetected = 0x2; - kFailedCommunication = 0x4; - kPositionFailure = 0x8; - } - - readonly attribute enum8 barrierMovingState = 1; - readonly attribute bitmap16 barrierSafetyStatus = 2; - readonly attribute bitmap8 barrierCapabilities = 3; - attribute optional int16u barrierOpenEvents = 4; - attribute optional int16u barrierCloseEvents = 5; - attribute optional int16u barrierCommandOpenEvents = 6; - attribute optional int16u barrierCommandCloseEvents = 7; - attribute optional int16u barrierOpenPeriod = 8; - attribute optional int16u barrierClosePeriod = 9; - readonly attribute int8u barrierPosition = 10; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - request struct BarrierControlGoToPercentRequest { - int8u percentOpen = 0; - } - - /** Command to instruct a barrier to go to a percent open state. */ - command BarrierControlGoToPercent(BarrierControlGoToPercentRequest): DefaultSuccess = 0; - /** Command that instructs the barrier to stop moving. */ - command BarrierControlStop(): DefaultSuccess = 1; -} - /** The Service Area cluster provides an interface for controlling the areas where a device should operate, and for querying the current area being serviced. */ provisional cluster ServiceArea = 336 { revision 1; @@ -9570,173 +9493,6 @@ provisional cluster CommissionerControl = 1873 { command access(invoke: manage) CommissionNode(CommissionNodeRequest): ReverseOpenCommissioningWindow = 1; } -/** Attributes related to the electrical properties of a device. This cluster is used by power outlets and other devices that need to provide instantaneous data as opposed to metrology data which should be retrieved from the metering cluster.. */ -deprecated cluster ElectricalMeasurement = 2820 { - revision 3; - - readonly attribute optional bitmap32 measurementType = 0; - readonly attribute optional int16s dcVoltage = 256; - readonly attribute optional int16s dcVoltageMin = 257; - readonly attribute optional int16s dcVoltageMax = 258; - readonly attribute optional int16s dcCurrent = 259; - readonly attribute optional int16s dcCurrentMin = 260; - readonly attribute optional int16s dcCurrentMax = 261; - readonly attribute optional int16s dcPower = 262; - readonly attribute optional int16s dcPowerMin = 263; - readonly attribute optional int16s dcPowerMax = 264; - readonly attribute optional int16u dcVoltageMultiplier = 512; - readonly attribute optional int16u dcVoltageDivisor = 513; - readonly attribute optional int16u dcCurrentMultiplier = 514; - readonly attribute optional int16u dcCurrentDivisor = 515; - readonly attribute optional int16u dcPowerMultiplier = 516; - readonly attribute optional int16u dcPowerDivisor = 517; - readonly attribute optional int16u acFrequency = 768; - readonly attribute optional int16u acFrequencyMin = 769; - readonly attribute optional int16u acFrequencyMax = 770; - readonly attribute optional int16u neutralCurrent = 771; - readonly attribute optional int32s totalActivePower = 772; - readonly attribute optional int32s totalReactivePower = 773; - readonly attribute optional int32u totalApparentPower = 774; - readonly attribute optional int16s measured1stHarmonicCurrent = 775; - readonly attribute optional int16s measured3rdHarmonicCurrent = 776; - readonly attribute optional int16s measured5thHarmonicCurrent = 777; - readonly attribute optional int16s measured7thHarmonicCurrent = 778; - readonly attribute optional int16s measured9thHarmonicCurrent = 779; - readonly attribute optional int16s measured11thHarmonicCurrent = 780; - readonly attribute optional int16s measuredPhase1stHarmonicCurrent = 781; - readonly attribute optional int16s measuredPhase3rdHarmonicCurrent = 782; - readonly attribute optional int16s measuredPhase5thHarmonicCurrent = 783; - readonly attribute optional int16s measuredPhase7thHarmonicCurrent = 784; - readonly attribute optional int16s measuredPhase9thHarmonicCurrent = 785; - readonly attribute optional int16s measuredPhase11thHarmonicCurrent = 786; - readonly attribute optional int16u acFrequencyMultiplier = 1024; - readonly attribute optional int16u acFrequencyDivisor = 1025; - readonly attribute optional int32u powerMultiplier = 1026; - readonly attribute optional int32u powerDivisor = 1027; - readonly attribute optional int8s harmonicCurrentMultiplier = 1028; - readonly attribute optional int8s phaseHarmonicCurrentMultiplier = 1029; - readonly attribute optional int16s instantaneousVoltage = 1280; - readonly attribute optional int16u instantaneousLineCurrent = 1281; - readonly attribute optional int16s instantaneousActiveCurrent = 1282; - readonly attribute optional int16s instantaneousReactiveCurrent = 1283; - readonly attribute optional int16s instantaneousPower = 1284; - readonly attribute optional int16u rmsVoltage = 1285; - readonly attribute optional int16u rmsVoltageMin = 1286; - readonly attribute optional int16u rmsVoltageMax = 1287; - readonly attribute optional int16u rmsCurrent = 1288; - readonly attribute optional int16u rmsCurrentMin = 1289; - readonly attribute optional int16u rmsCurrentMax = 1290; - readonly attribute optional int16s activePower = 1291; - readonly attribute optional int16s activePowerMin = 1292; - readonly attribute optional int16s activePowerMax = 1293; - readonly attribute optional int16s reactivePower = 1294; - readonly attribute optional int16u apparentPower = 1295; - readonly attribute optional int8s powerFactor = 1296; - attribute optional int16u averageRmsVoltageMeasurementPeriod = 1297; - attribute optional int16u averageRmsUnderVoltageCounter = 1299; - attribute optional int16u rmsExtremeOverVoltagePeriod = 1300; - attribute optional int16u rmsExtremeUnderVoltagePeriod = 1301; - attribute optional int16u rmsVoltageSagPeriod = 1302; - attribute optional int16u rmsVoltageSwellPeriod = 1303; - readonly attribute optional int16u acVoltageMultiplier = 1536; - readonly attribute optional int16u acVoltageDivisor = 1537; - readonly attribute optional int16u acCurrentMultiplier = 1538; - readonly attribute optional int16u acCurrentDivisor = 1539; - readonly attribute optional int16u acPowerMultiplier = 1540; - readonly attribute optional int16u acPowerDivisor = 1541; - attribute optional bitmap8 overloadAlarmsMask = 1792; - readonly attribute optional int16s voltageOverload = 1793; - readonly attribute optional int16s currentOverload = 1794; - attribute optional bitmap16 acOverloadAlarmsMask = 2048; - readonly attribute optional int16s acVoltageOverload = 2049; - readonly attribute optional int16s acCurrentOverload = 2050; - readonly attribute optional int16s acActivePowerOverload = 2051; - readonly attribute optional int16s acReactivePowerOverload = 2052; - readonly attribute optional int16s averageRmsOverVoltage = 2053; - readonly attribute optional int16s averageRmsUnderVoltage = 2054; - readonly attribute optional int16s rmsExtremeOverVoltage = 2055; - readonly attribute optional int16s rmsExtremeUnderVoltage = 2056; - readonly attribute optional int16s rmsVoltageSag = 2057; - readonly attribute optional int16s rmsVoltageSwell = 2058; - readonly attribute optional int16u lineCurrentPhaseB = 2305; - readonly attribute optional int16s activeCurrentPhaseB = 2306; - readonly attribute optional int16s reactiveCurrentPhaseB = 2307; - readonly attribute optional int16u rmsVoltagePhaseB = 2309; - readonly attribute optional int16u rmsVoltageMinPhaseB = 2310; - readonly attribute optional int16u rmsVoltageMaxPhaseB = 2311; - readonly attribute optional int16u rmsCurrentPhaseB = 2312; - readonly attribute optional int16u rmsCurrentMinPhaseB = 2313; - readonly attribute optional int16u rmsCurrentMaxPhaseB = 2314; - readonly attribute optional int16s activePowerPhaseB = 2315; - readonly attribute optional int16s activePowerMinPhaseB = 2316; - readonly attribute optional int16s activePowerMaxPhaseB = 2317; - readonly attribute optional int16s reactivePowerPhaseB = 2318; - readonly attribute optional int16u apparentPowerPhaseB = 2319; - readonly attribute optional int8s powerFactorPhaseB = 2320; - readonly attribute optional int16u averageRmsVoltageMeasurementPeriodPhaseB = 2321; - readonly attribute optional int16u averageRmsOverVoltageCounterPhaseB = 2322; - readonly attribute optional int16u averageRmsUnderVoltageCounterPhaseB = 2323; - readonly attribute optional int16u rmsExtremeOverVoltagePeriodPhaseB = 2324; - readonly attribute optional int16u rmsExtremeUnderVoltagePeriodPhaseB = 2325; - readonly attribute optional int16u rmsVoltageSagPeriodPhaseB = 2326; - readonly attribute optional int16u rmsVoltageSwellPeriodPhaseB = 2327; - readonly attribute optional int16u lineCurrentPhaseC = 2561; - readonly attribute optional int16s activeCurrentPhaseC = 2562; - readonly attribute optional int16s reactiveCurrentPhaseC = 2563; - readonly attribute optional int16u rmsVoltagePhaseC = 2565; - readonly attribute optional int16u rmsVoltageMinPhaseC = 2566; - readonly attribute optional int16u rmsVoltageMaxPhaseC = 2567; - readonly attribute optional int16u rmsCurrentPhaseC = 2568; - readonly attribute optional int16u rmsCurrentMinPhaseC = 2569; - readonly attribute optional int16u rmsCurrentMaxPhaseC = 2570; - readonly attribute optional int16s activePowerPhaseC = 2571; - readonly attribute optional int16s activePowerMinPhaseC = 2572; - readonly attribute optional int16s activePowerMaxPhaseC = 2573; - readonly attribute optional int16s reactivePowerPhaseC = 2574; - readonly attribute optional int16u apparentPowerPhaseC = 2575; - readonly attribute optional int8s powerFactorPhaseC = 2576; - readonly attribute optional int16u averageRmsVoltageMeasurementPeriodPhaseC = 2577; - readonly attribute optional int16u averageRmsOverVoltageCounterPhaseC = 2578; - readonly attribute optional int16u averageRmsUnderVoltageCounterPhaseC = 2579; - readonly attribute optional int16u rmsExtremeOverVoltagePeriodPhaseC = 2580; - readonly attribute optional int16u rmsExtremeUnderVoltagePeriodPhaseC = 2581; - readonly attribute optional int16u rmsVoltageSagPeriodPhaseC = 2582; - readonly attribute optional int16u rmsVoltageSwellPeriodPhaseC = 2583; - readonly attribute command_id generatedCommandList[] = 65528; - readonly attribute command_id acceptedCommandList[] = 65529; - readonly attribute event_id eventList[] = 65530; - readonly attribute attrib_id attributeList[] = 65531; - readonly attribute bitmap32 featureMap = 65532; - readonly attribute int16u clusterRevision = 65533; - - response struct GetProfileInfoResponseCommand = 0 { - int8u profileCount = 0; - enum8 profileIntervalPeriod = 1; - int8u maxNumberOfIntervals = 2; - int16u listOfAttributes[] = 3; - } - - response struct GetMeasurementProfileResponseCommand = 1 { - int32u startTime = 0; - enum8 status = 1; - enum8 profileIntervalPeriod = 2; - int8u numberOfIntervalsDelivered = 3; - int16u attributeId = 4; - int8u intervals[] = 5; - } - - request struct GetMeasurementProfileCommandRequest { - int16u attributeId = 0; - int32u startTime = 1; - enum8 numberOfIntervals = 2; - } - - /** A function which retrieves the power profiling information from the electrical measurement server. */ - command GetProfileInfoCommand(): DefaultSuccess = 0; - /** A function which retrieves an electricity measurement profile from the electricity measurement server for a specific attribute Id requested. */ - command GetMeasurementProfileCommand(GetMeasurementProfileCommandRequest): DefaultSuccess = 1; -} - /** The Test Cluster is meant to validate the generated code */ internal cluster UnitTesting = 4294048773 { revision 1; // NOTE: Default/not specifically set diff --git a/src/controller/data_model/controller-clusters.zap b/src/controller/data_model/controller-clusters.zap index 32b6ea18fc8fb8..1a1f8539267101 100644 --- a/src/controller/data_model/controller-clusters.zap +++ b/src/controller/data_model/controller-clusters.zap @@ -85,24 +85,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -193,24 +175,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -269,51 +233,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "On/off Switch Configuration", - "code": 7, - "mfgCode": null, - "define": "ON_OFF_SWITCH_CONFIGURATION_CLUSTER", - "side": "client", - "enabled": 1, - "apiMaturity": "deprecated", - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -388,67 +307,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Binary Input (Basic)", - "code": 15, - "mfgCode": null, - "define": "BINARY_INPUT_BASIC_CLUSTER", - "side": "client", - "enabled": 1, - "apiMaturity": "deprecated", - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -457,25 +315,7 @@ "mfgCode": null, "define": "DESCRIPTOR_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Binding", @@ -483,25 +323,7 @@ "mfgCode": null, "define": "BINDING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Access Control", @@ -509,25 +331,7 @@ "mfgCode": null, "define": "ACCESS_CONTROL_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Actions", @@ -633,24 +437,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -659,25 +445,7 @@ "mfgCode": null, "define": "BASIC_INFORMATION_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 1, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "OTA Software Update Provider", @@ -727,24 +495,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -763,24 +513,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -813,25 +545,7 @@ "mfgCode": null, "define": "POWER_SOURCE_CONFIGURATION_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Power Source", @@ -839,25 +553,7 @@ "mfgCode": null, "define": "POWER_SOURCE_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "General Commissioning", @@ -915,40 +611,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -1031,40 +693,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -1109,24 +737,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -1145,40 +755,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -1197,40 +773,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -1249,24 +791,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -1285,40 +809,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -1377,40 +867,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -1419,25 +875,7 @@ "mfgCode": null, "define": "BRIDGED_DEVICE_BASIC_INFORMATION_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Switch", @@ -1445,25 +883,7 @@ "mfgCode": null, "define": "SWITCH_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Administrator Commissioning", @@ -1497,24 +917,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -1621,24 +1023,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -1697,24 +1081,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -1723,25 +1089,7 @@ "mfgCode": null, "define": "FIXED_LABEL_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "User Label", @@ -1757,25 +1105,7 @@ "mfgCode": null, "define": "BOOLEAN_STATE_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "ICD Management", @@ -1825,40 +1155,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -1886,40 +1182,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -1928,41 +1190,7 @@ "mfgCode": null, "define": "OPERATIONAL_STATE_OVEN_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Oven Mode", @@ -1988,40 +1216,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -2030,41 +1224,7 @@ "mfgCode": null, "define": "LAUNDRY_DRYER_CONTROLS_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Mode Select", @@ -2082,40 +1242,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -2142,40 +1268,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -2202,40 +1294,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -2244,41 +1302,7 @@ "mfgCode": null, "define": "LAUNDRY_WASHER_CONTROLS_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "RVC Run Mode", @@ -2304,40 +1328,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -2364,40 +1354,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -2416,40 +1372,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -2458,41 +1380,7 @@ "mfgCode": null, "define": "REFRIGERATOR_ALARM_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Dishwasher Mode", @@ -2518,40 +1406,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -2560,41 +1414,7 @@ "mfgCode": null, "define": "AIR_QUALITY_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Smoke CO Alarm", @@ -2612,24 +1432,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -2648,40 +1450,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -2690,41 +1458,7 @@ "mfgCode": null, "define": "MICROWAVE_OVEN_MODE_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Microwave Oven Control", @@ -2742,40 +1476,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -2784,41 +1484,7 @@ "mfgCode": null, "define": "OPERATIONAL_STATE_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "RVC Operational State", @@ -2852,40 +1518,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -3001,24 +1633,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3027,41 +1641,7 @@ "mfgCode": null, "define": "HEPA_FILTER_MONITORING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Activated Carbon Filter Monitoring", @@ -3069,41 +1649,7 @@ "mfgCode": null, "define": "ACTIVATED_CARBON_FILTER_MONITORING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Electrical Power Measurement", @@ -3111,41 +1657,7 @@ "mfgCode": null, "define": "ELECTRICAL_POWER_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Electrical Energy Measurement", @@ -3153,41 +1665,7 @@ "mfgCode": null, "define": "ELECTRICAL_ENERGY_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Water Heater Management", @@ -3214,40 +1692,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -3257,41 +1701,7 @@ "define": "DEVICE_ENERGY_MANAGEMENT_CLUSTER", "side": "client", "enabled": 1, - "apiMaturity": "provisional", - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "apiMaturity": "provisional" }, { "name": "Energy EVSE", @@ -3317,40 +1727,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -3359,41 +1735,7 @@ "mfgCode": null, "define": "POWER_TOPOLOGY_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Energy EVSE Mode", @@ -3419,40 +1761,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -3479,40 +1787,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -3540,40 +1814,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -3776,24 +2016,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3860,69 +2082,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Barrier Control", - "code": 259, - "mfgCode": null, - "define": "BARRIER_CONTROL_CLUSTER", - "side": "client", - "enabled": 1, - "apiMaturity": "deprecated", - "commands": [ - { - "name": "BarrierControlGoToPercent", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - }, - { - "name": "BarrierControlStop", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 0, - "isEnabled": 1 - } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -3931,41 +2090,7 @@ "mfgCode": null, "define": "PUMP_CONFIGURATION_AND_CONTROL_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Thermostat", @@ -4015,24 +2140,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "6", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -4049,25 +2156,7 @@ "mfgCode": null, "define": "THERMOSTAT_USER_INTERFACE_CONFIGURATION_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Color Control", @@ -4229,24 +2318,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "7", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -4256,41 +2327,7 @@ "define": "BALLAST_CONFIGURATION_CLUSTER", "side": "client", "enabled": 1, - "apiMaturity": "provisional", - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "apiMaturity": "provisional" }, { "name": "Illuminance Measurement", @@ -4298,25 +2335,7 @@ "mfgCode": null, "define": "ILLUMINANCE_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Temperature Measurement", @@ -4324,25 +2343,7 @@ "mfgCode": null, "define": "TEMPERATURE_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "4", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Pressure Measurement", @@ -4350,25 +2351,7 @@ "mfgCode": null, "define": "PRESSURE_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Flow Measurement", @@ -4376,25 +2359,7 @@ "mfgCode": null, "define": "FLOW_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Relative Humidity Measurement", @@ -4402,25 +2367,7 @@ "mfgCode": null, "define": "RELATIVE_HUMIDITY_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Occupancy Sensing", @@ -4428,25 +2375,7 @@ "mfgCode": null, "define": "OCCUPANCY_SENSING_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "5", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Carbon Monoxide Concentration Measurement", @@ -4454,41 +2383,7 @@ "mfgCode": null, "define": "CARBON_MONOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Carbon Dioxide Concentration Measurement", @@ -4496,41 +2391,7 @@ "mfgCode": null, "define": "CARBON_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Nitrogen Dioxide Concentration Measurement", @@ -4538,41 +2399,7 @@ "mfgCode": null, "define": "NITROGEN_DIOXIDE_CONCENTRATION_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Ozone Concentration Measurement", @@ -4580,41 +2407,7 @@ "mfgCode": null, "define": "OZONE_CONCENTRATION_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "PM2.5 Concentration Measurement", @@ -4622,41 +2415,7 @@ "mfgCode": null, "define": "PM2_5_CONCENTRATION_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Formaldehyde Concentration Measurement", @@ -4664,41 +2423,7 @@ "mfgCode": null, "define": "FORMALDEHYDE_CONCENTRATION_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "PM1 Concentration Measurement", @@ -4706,41 +2431,7 @@ "mfgCode": null, "define": "PM1_CONCENTRATION_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "PM10 Concentration Measurement", @@ -4748,41 +2439,7 @@ "mfgCode": null, "define": "PM10_CONCENTRATION_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Total Volatile Organic Compounds Concentration Measurement", @@ -4790,41 +2447,7 @@ "mfgCode": null, "define": "TVOC_CONCENTRATION_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Radon Concentration Measurement", @@ -4832,41 +2455,7 @@ "mfgCode": null, "define": "RADON_CONCENTRATION_MEASUREMENT_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Thread Border Router Management", @@ -4901,40 +2490,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "2", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -4978,40 +2533,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] }, { @@ -5020,25 +2541,7 @@ "mfgCode": null, "define": "WAKE_ON_LAN_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Channel", @@ -5080,24 +2583,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -5124,24 +2609,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -5248,24 +2715,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -5308,24 +2757,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -5344,24 +2775,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -5388,24 +2801,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -5440,24 +2835,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -5484,24 +2861,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -5544,24 +2903,6 @@ "isIncoming": 1, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -5570,25 +2911,7 @@ "mfgCode": null, "define": "APPLICATION_BASIC_CLUSTER", "side": "client", - "enabled": 1, - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] + "enabled": 1 }, { "name": "Account Login", @@ -5630,51 +2953,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } - ] - }, - { - "name": "Electrical Measurement", - "code": 2820, - "mfgCode": null, - "define": "ELECTRICAL_MEASUREMENT_CLUSTER", - "side": "client", - "enabled": 1, - "apiMaturity": "deprecated", - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "3", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -5894,24 +3172,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 0, - "maxInterval": 65344, - "reportableChange": 0 - } ] }, { @@ -5946,40 +3206,6 @@ "isIncoming": 0, "isEnabled": 1 } - ], - "attributes": [ - { - "name": "FeatureMap", - "code": 65532, - "mfgCode": null, - "side": "client", - "type": "bitmap32", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "0", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - }, - { - "name": "ClusterRevision", - "code": 65533, - "mfgCode": null, - "side": "client", - "type": "int16u", - "included": 1, - "storageOption": "RAM", - "singleton": 0, - "bounded": 0, - "defaultValue": "1", - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 - } ] } ] diff --git a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java index ce3d602f1f89b6..2ce04c328ded6f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ChipClusters.java @@ -1504,262 +1504,6 @@ public void onSuccess(byte[] tlv) { } } - public static class OnOffSwitchConfigurationCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 7L; - - private static final long SWITCH_TYPE_ATTRIBUTE_ID = 0L; - private static final long SWITCH_ACTIONS_ATTRIBUTE_ID = 16L; - private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; - private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; - private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; - private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; - private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; - private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; - - public OnOffSwitchConfigurationCluster(long devicePtr, int endpointId) { - super(devicePtr, endpointId, CLUSTER_ID); - } - - @Override - @Deprecated - public long initWithDevice(long devicePtr, int endpointId) { - return 0L; - } - - public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface EventListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface AttributeListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public void readSwitchTypeAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SWITCH_TYPE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, SWITCH_TYPE_ATTRIBUTE_ID, true); - } - - public void subscribeSwitchTypeAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SWITCH_TYPE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, SWITCH_TYPE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readSwitchActionsAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SWITCH_ACTIONS_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, SWITCH_ACTIONS_ATTRIBUTE_ID, true); - } - - public void writeSwitchActionsAttribute(DefaultClusterCallback callback, Integer value) { - writeSwitchActionsAttribute(callback, value, 0); - } - - public void writeSwitchActionsAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), SWITCH_ACTIONS_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeSwitchActionsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SWITCH_ACTIONS_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, SWITCH_ACTIONS_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcceptedCommandListAttribute( - AcceptedCommandListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeAcceptedCommandListAttribute( - AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readEventListAttribute( - EventListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, EVENT_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeEventListAttribute( - EventListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAttributeListAttribute( - AttributeListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeAttributeListAttribute( - AttributeListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readFeatureMapAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, FEATURE_MAP_ATTRIBUTE_ID, true); - } - - public void subscribeFeatureMapAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readClusterRevisionAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, CLUSTER_REVISION_ATTRIBUTE_ID, true); - } - - public void subscribeClusterRevisionAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); - } - } - public static class LevelControlCluster extends BaseChipCluster { public static final long CLUSTER_ID = 8L; @@ -2686,18 +2430,9 @@ public void onSuccess(byte[] tlv) { } } - public static class BinaryInputBasicCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 15L; - - private static final long ACTIVE_TEXT_ATTRIBUTE_ID = 4L; - private static final long DESCRIPTION_ATTRIBUTE_ID = 28L; - private static final long INACTIVE_TEXT_ATTRIBUTE_ID = 46L; - private static final long OUT_OF_SERVICE_ATTRIBUTE_ID = 81L; - private static final long POLARITY_ATTRIBUTE_ID = 84L; - private static final long PRESENT_VALUE_ATTRIBUTE_ID = 85L; - private static final long RELIABILITY_ATTRIBUTE_ID = 103L; - private static final long STATUS_FLAGS_ATTRIBUTE_ID = 111L; - private static final long APPLICATION_TYPE_ATTRIBUTE_ID = 256L; + public static class PulseWidthModulationCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 28L; + private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; @@ -2705,488 +2440,7 @@ public static class BinaryInputBasicCluster extends BaseChipCluster { private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; - public BinaryInputBasicCluster(long devicePtr, int endpointId) { - super(devicePtr, endpointId, CLUSTER_ID); - } - - @Override - @Deprecated - public long initWithDevice(long devicePtr, int endpointId) { - return 0L; - } - - public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface EventListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface AttributeListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public void readActiveTextAttribute( - CharStringAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_TEXT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_TEXT_ATTRIBUTE_ID, true); - } - - public void writeActiveTextAttribute(DefaultClusterCallback callback, String value) { - writeActiveTextAttribute(callback, value, 0); - } - - public void writeActiveTextAttribute(DefaultClusterCallback callback, String value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new StringType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), ACTIVE_TEXT_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeActiveTextAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_TEXT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_TEXT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDescriptionAttribute( - CharStringAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DESCRIPTION_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DESCRIPTION_ATTRIBUTE_ID, true); - } - - public void writeDescriptionAttribute(DefaultClusterCallback callback, String value) { - writeDescriptionAttribute(callback, value, 0); - } - - public void writeDescriptionAttribute(DefaultClusterCallback callback, String value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new StringType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), DESCRIPTION_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeDescriptionAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DESCRIPTION_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DESCRIPTION_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readInactiveTextAttribute( - CharStringAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INACTIVE_TEXT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, INACTIVE_TEXT_ATTRIBUTE_ID, true); - } - - public void writeInactiveTextAttribute(DefaultClusterCallback callback, String value) { - writeInactiveTextAttribute(callback, value, 0); - } - - public void writeInactiveTextAttribute(DefaultClusterCallback callback, String value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new StringType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), INACTIVE_TEXT_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeInactiveTextAttribute( - CharStringAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INACTIVE_TEXT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - String value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, INACTIVE_TEXT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readOutOfServiceAttribute( - BooleanAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, OUT_OF_SERVICE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, OUT_OF_SERVICE_ATTRIBUTE_ID, true); - } - - public void writeOutOfServiceAttribute(DefaultClusterCallback callback, Boolean value) { - writeOutOfServiceAttribute(callback, value, 0); - } - - public void writeOutOfServiceAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new BooleanType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), OUT_OF_SERVICE_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeOutOfServiceAttribute( - BooleanAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, OUT_OF_SERVICE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, OUT_OF_SERVICE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readPolarityAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POLARITY_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, POLARITY_ATTRIBUTE_ID, true); - } - - public void subscribePolarityAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POLARITY_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, POLARITY_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readPresentValueAttribute( - BooleanAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PRESENT_VALUE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, PRESENT_VALUE_ATTRIBUTE_ID, true); - } - - public void writePresentValueAttribute(DefaultClusterCallback callback, Boolean value) { - writePresentValueAttribute(callback, value, 0); - } - - public void writePresentValueAttribute(DefaultClusterCallback callback, Boolean value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new BooleanType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), PRESENT_VALUE_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribePresentValueAttribute( - BooleanAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PRESENT_VALUE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Boolean value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, PRESENT_VALUE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readReliabilityAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RELIABILITY_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RELIABILITY_ATTRIBUTE_ID, true); - } - - public void writeReliabilityAttribute(DefaultClusterCallback callback, Integer value) { - writeReliabilityAttribute(callback, value, 0); - } - - public void writeReliabilityAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), RELIABILITY_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeReliabilityAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RELIABILITY_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RELIABILITY_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readStatusFlagsAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, STATUS_FLAGS_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, STATUS_FLAGS_ATTRIBUTE_ID, true); - } - - public void subscribeStatusFlagsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, STATUS_FLAGS_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, STATUS_FLAGS_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readApplicationTypeAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPLICATION_TYPE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, APPLICATION_TYPE_ATTRIBUTE_ID, true); - } - - public void subscribeApplicationTypeAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPLICATION_TYPE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, APPLICATION_TYPE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcceptedCommandListAttribute( - AcceptedCommandListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeAcceptedCommandListAttribute( - AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readEventListAttribute( - EventListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, EVENT_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeEventListAttribute( - EventListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAttributeListAttribute( - AttributeListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeAttributeListAttribute( - AttributeListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readFeatureMapAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, FEATURE_MAP_ATTRIBUTE_ID, true); - } - - public void subscribeFeatureMapAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readClusterRevisionAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, CLUSTER_REVISION_ATTRIBUTE_ID, true); - } - - public void subscribeClusterRevisionAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); - } - } - - public static class PulseWidthModulationCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 28L; - - private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; - private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; - private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; - private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; - private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; - private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; - - public PulseWidthModulationCluster(long devicePtr, int endpointId) { + public PulseWidthModulationCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId, CLUSTER_ID); } @@ -38492,19 +37746,15 @@ public void onSuccess(byte[] tlv) { } } - public static class BarrierControlCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 259L; - - private static final long BARRIER_MOVING_STATE_ATTRIBUTE_ID = 1L; - private static final long BARRIER_SAFETY_STATUS_ATTRIBUTE_ID = 2L; - private static final long BARRIER_CAPABILITIES_ATTRIBUTE_ID = 3L; - private static final long BARRIER_OPEN_EVENTS_ATTRIBUTE_ID = 4L; - private static final long BARRIER_CLOSE_EVENTS_ATTRIBUTE_ID = 5L; - private static final long BARRIER_COMMAND_OPEN_EVENTS_ATTRIBUTE_ID = 6L; - private static final long BARRIER_COMMAND_CLOSE_EVENTS_ATTRIBUTE_ID = 7L; - private static final long BARRIER_OPEN_PERIOD_ATTRIBUTE_ID = 8L; - private static final long BARRIER_CLOSE_PERIOD_ATTRIBUTE_ID = 9L; - private static final long BARRIER_POSITION_ATTRIBUTE_ID = 10L; + public static class ServiceAreaCluster extends BaseChipCluster { + public static final long CLUSTER_ID = 336L; + + private static final long SUPPORTED_AREAS_ATTRIBUTE_ID = 0L; + private static final long SUPPORTED_MAPS_ATTRIBUTE_ID = 1L; + private static final long SELECTED_AREAS_ATTRIBUTE_ID = 2L; + private static final long CURRENT_AREA_ATTRIBUTE_ID = 3L; + private static final long ESTIMATED_END_TIME_ATTRIBUTE_ID = 4L; + private static final long PROGRESS_ATTRIBUTE_ID = 5L; private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; @@ -38512,7 +37762,7 @@ public static class BarrierControlCluster extends BaseChipCluster { private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; - public BarrierControlCluster(long devicePtr, int endpointId) { + public ServiceAreaCluster(long devicePtr, int endpointId) { super(devicePtr, endpointId, CLUSTER_ID); } @@ -38522,831 +37772,282 @@ public long initWithDevice(long devicePtr, int endpointId) { return 0L; } - public void barrierControlGoToPercent(DefaultClusterCallback callback, Integer percentOpen) { - barrierControlGoToPercent(callback, percentOpen, 0); + public void selectAreas(SelectAreasResponseCallback callback, ArrayList newAreas) { + selectAreas(callback, newAreas, 0); } - public void barrierControlGoToPercent(DefaultClusterCallback callback, Integer percentOpen, int timedInvokeTimeoutMs) { + public void selectAreas(SelectAreasResponseCallback callback, ArrayList newAreas, int timedInvokeTimeoutMs) { final long commandId = 0L; ArrayList elements = new ArrayList<>(); - final long percentOpenFieldID = 0L; - BaseTLVType percentOpentlvValue = new UIntType(percentOpen); - elements.add(new StructElement(percentOpenFieldID, percentOpentlvValue)); + final long newAreasFieldID = 0L; + BaseTLVType newAreastlvValue = ArrayType.generateArrayType(newAreas, (elementnewAreas) -> new UIntType(elementnewAreas)); + elements.add(new StructElement(newAreasFieldID, newAreastlvValue)); StructType commandArgs = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @Override public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); + final long statusFieldID = 0L; + Integer status = null; + final long statusTextFieldID = 1L; + String statusText = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == statusFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + status = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == statusTextFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + statusText = castingValue.value(String.class); + } + } + } + callback.onSuccess(status, statusText); }}, commandId, commandArgs, timedInvokeTimeoutMs); } - public void barrierControlStop(DefaultClusterCallback callback) { - barrierControlStop(callback, 0); + public void skipArea(SkipAreaResponseCallback callback, Long skippedArea) { + skipArea(callback, skippedArea, 0); } - public void barrierControlStop(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { - final long commandId = 1L; + public void skipArea(SkipAreaResponseCallback callback, Long skippedArea, int timedInvokeTimeoutMs) { + final long commandId = 2L; ArrayList elements = new ArrayList<>(); + final long skippedAreaFieldID = 0L; + BaseTLVType skippedAreatlvValue = new UIntType(skippedArea); + elements.add(new StructElement(skippedAreaFieldID, skippedAreatlvValue)); + StructType commandArgs = new StructType(elements); invoke(new InvokeCallbackImpl(callback) { @Override public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); + final long statusFieldID = 0L; + Integer status = null; + final long statusTextFieldID = 1L; + String statusText = null; + for (StructElement element: invokeStructValue.value()) { + if (element.contextTagNum() == statusFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.UInt) { + UIntType castingValue = element.value(UIntType.class); + status = castingValue.value(Integer.class); + } + } else if (element.contextTagNum() == statusTextFieldID) { + if (element.value(BaseTLVType.class).type() == TLVType.String) { + StringType castingValue = element.value(StringType.class); + statusText = castingValue.value(String.class); + } + } + } + callback.onSuccess(status, statusText); }}, commandId, commandArgs, timedInvokeTimeoutMs); } - public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface EventListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public interface SelectAreasResponseCallback extends BaseClusterCallback { + void onSuccess(Integer status, String statusText); } - public interface AttributeListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); + public interface SkipAreaResponseCallback extends BaseClusterCallback { + void onSuccess(Integer status, String statusText); } - public void readBarrierMovingStateAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_MOVING_STATE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, BARRIER_MOVING_STATE_ATTRIBUTE_ID, true); + public interface SupportedAreasAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); } - public void subscribeBarrierMovingStateAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_MOVING_STATE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, BARRIER_MOVING_STATE_ATTRIBUTE_ID, minInterval, maxInterval); + public interface SupportedMapsAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); } - public void readBarrierSafetyStatusAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_SAFETY_STATUS_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, BARRIER_SAFETY_STATUS_ATTRIBUTE_ID, true); + public interface SelectedAreasAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); } - public void subscribeBarrierSafetyStatusAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_SAFETY_STATUS_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, BARRIER_SAFETY_STATUS_ATTRIBUTE_ID, minInterval, maxInterval); + public interface CurrentAreaAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); } - public void readBarrierCapabilitiesAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_CAPABILITIES_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, BARRIER_CAPABILITIES_ATTRIBUTE_ID, true); + public interface EstimatedEndTimeAttributeCallback extends BaseAttributeCallback { + void onSuccess(@Nullable Long value); } - public void subscribeBarrierCapabilitiesAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_CAPABILITIES_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, BARRIER_CAPABILITIES_ATTRIBUTE_ID, minInterval, maxInterval); + public interface ProgressAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); } - public void readBarrierOpenEventsAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_OPEN_EVENTS_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, BARRIER_OPEN_EVENTS_ATTRIBUTE_ID, true); + public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); } - public void writeBarrierOpenEventsAttribute(DefaultClusterCallback callback, Integer value) { - writeBarrierOpenEventsAttribute(callback, value, 0); + public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); } - public void writeBarrierOpenEventsAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), BARRIER_OPEN_EVENTS_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + public interface EventListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); } - public void subscribeBarrierOpenEventsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_OPEN_EVENTS_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, BARRIER_OPEN_EVENTS_ATTRIBUTE_ID, minInterval, maxInterval); + public interface AttributeListAttributeCallback extends BaseAttributeCallback { + void onSuccess(List value); } - public void readBarrierCloseEventsAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_CLOSE_EVENTS_ATTRIBUTE_ID); + public void readSupportedAreasAttribute( + SupportedAreasAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_AREAS_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, BARRIER_CLOSE_EVENTS_ATTRIBUTE_ID, true); - } - - public void writeBarrierCloseEventsAttribute(DefaultClusterCallback callback, Integer value) { - writeBarrierCloseEventsAttribute(callback, value, 0); - } - - public void writeBarrierCloseEventsAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), BARRIER_CLOSE_EVENTS_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + }, SUPPORTED_AREAS_ATTRIBUTE_ID, true); } - public void subscribeBarrierCloseEventsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_CLOSE_EVENTS_ATTRIBUTE_ID); + public void subscribeSupportedAreasAttribute( + SupportedAreasAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_AREAS_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, BARRIER_CLOSE_EVENTS_ATTRIBUTE_ID, minInterval, maxInterval); + }, SUPPORTED_AREAS_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readBarrierCommandOpenEventsAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_COMMAND_OPEN_EVENTS_ATTRIBUTE_ID); + public void readSupportedMapsAttribute( + SupportedMapsAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_MAPS_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, BARRIER_COMMAND_OPEN_EVENTS_ATTRIBUTE_ID, true); - } - - public void writeBarrierCommandOpenEventsAttribute(DefaultClusterCallback callback, Integer value) { - writeBarrierCommandOpenEventsAttribute(callback, value, 0); - } - - public void writeBarrierCommandOpenEventsAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), BARRIER_COMMAND_OPEN_EVENTS_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + }, SUPPORTED_MAPS_ATTRIBUTE_ID, true); } - public void subscribeBarrierCommandOpenEventsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_COMMAND_OPEN_EVENTS_ATTRIBUTE_ID); + public void subscribeSupportedMapsAttribute( + SupportedMapsAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_MAPS_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, BARRIER_COMMAND_OPEN_EVENTS_ATTRIBUTE_ID, minInterval, maxInterval); + }, SUPPORTED_MAPS_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readBarrierCommandCloseEventsAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_COMMAND_CLOSE_EVENTS_ATTRIBUTE_ID); + public void readSelectedAreasAttribute( + SelectedAreasAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SELECTED_AREAS_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, BARRIER_COMMAND_CLOSE_EVENTS_ATTRIBUTE_ID, true); - } - - public void writeBarrierCommandCloseEventsAttribute(DefaultClusterCallback callback, Integer value) { - writeBarrierCommandCloseEventsAttribute(callback, value, 0); - } - - public void writeBarrierCommandCloseEventsAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), BARRIER_COMMAND_CLOSE_EVENTS_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + }, SELECTED_AREAS_ATTRIBUTE_ID, true); } - public void subscribeBarrierCommandCloseEventsAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_COMMAND_CLOSE_EVENTS_ATTRIBUTE_ID); + public void subscribeSelectedAreasAttribute( + SelectedAreasAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SELECTED_AREAS_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, BARRIER_COMMAND_CLOSE_EVENTS_ATTRIBUTE_ID, minInterval, maxInterval); + }, SELECTED_AREAS_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readBarrierOpenPeriodAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_OPEN_PERIOD_ATTRIBUTE_ID); + public void readCurrentAreaAttribute( + CurrentAreaAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_AREA_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, BARRIER_OPEN_PERIOD_ATTRIBUTE_ID, true); - } - - public void writeBarrierOpenPeriodAttribute(DefaultClusterCallback callback, Integer value) { - writeBarrierOpenPeriodAttribute(callback, value, 0); - } - - public void writeBarrierOpenPeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), BARRIER_OPEN_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + }, CURRENT_AREA_ATTRIBUTE_ID, true); } - public void subscribeBarrierOpenPeriodAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_OPEN_PERIOD_ATTRIBUTE_ID); + public void subscribeCurrentAreaAttribute( + CurrentAreaAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_AREA_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, BARRIER_OPEN_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); + }, CURRENT_AREA_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readBarrierClosePeriodAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_CLOSE_PERIOD_ATTRIBUTE_ID); + public void readEstimatedEndTimeAttribute( + EstimatedEndTimeAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ESTIMATED_END_TIME_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, BARRIER_CLOSE_PERIOD_ATTRIBUTE_ID, true); - } - - public void writeBarrierClosePeriodAttribute(DefaultClusterCallback callback, Integer value) { - writeBarrierClosePeriodAttribute(callback, value, 0); - } - - public void writeBarrierClosePeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), BARRIER_CLOSE_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); + }, ESTIMATED_END_TIME_ATTRIBUTE_ID, true); } - public void subscribeBarrierClosePeriodAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_CLOSE_PERIOD_ATTRIBUTE_ID); + public void subscribeEstimatedEndTimeAttribute( + EstimatedEndTimeAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ESTIMATED_END_TIME_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, BARRIER_CLOSE_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); + }, ESTIMATED_END_TIME_ATTRIBUTE_ID, minInterval, maxInterval); } - public void readBarrierPositionAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_POSITION_ATTRIBUTE_ID); + public void readProgressAttribute( + ProgressAttributeCallback callback) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PROGRESS_ATTRIBUTE_ID); readAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, BARRIER_POSITION_ATTRIBUTE_ID, true); + }, PROGRESS_ATTRIBUTE_ID, true); } - public void subscribeBarrierPositionAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, BARRIER_POSITION_ATTRIBUTE_ID); + public void subscribeProgressAttribute( + ProgressAttributeCallback callback, int minInterval, int maxInterval) { + ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PROGRESS_ATTRIBUTE_ID); subscribeAttribute(new ReportCallbackImpl(callback, path) { @Override public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); + List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); callback.onSuccess(value); } - }, BARRIER_POSITION_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcceptedCommandListAttribute( - AcceptedCommandListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeAcceptedCommandListAttribute( - AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readEventListAttribute( - EventListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, EVENT_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeEventListAttribute( - EventListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAttributeListAttribute( - AttributeListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeAttributeListAttribute( - AttributeListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readFeatureMapAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, FEATURE_MAP_ATTRIBUTE_ID, true); - } - - public void subscribeFeatureMapAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readClusterRevisionAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, CLUSTER_REVISION_ATTRIBUTE_ID, true); - } - - public void subscribeClusterRevisionAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); - } - } - - public static class ServiceAreaCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 336L; - - private static final long SUPPORTED_AREAS_ATTRIBUTE_ID = 0L; - private static final long SUPPORTED_MAPS_ATTRIBUTE_ID = 1L; - private static final long SELECTED_AREAS_ATTRIBUTE_ID = 2L; - private static final long CURRENT_AREA_ATTRIBUTE_ID = 3L; - private static final long ESTIMATED_END_TIME_ATTRIBUTE_ID = 4L; - private static final long PROGRESS_ATTRIBUTE_ID = 5L; - private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; - private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; - private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; - private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; - private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; - private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; - - public ServiceAreaCluster(long devicePtr, int endpointId) { - super(devicePtr, endpointId, CLUSTER_ID); - } - - @Override - @Deprecated - public long initWithDevice(long devicePtr, int endpointId) { - return 0L; - } - - public void selectAreas(SelectAreasResponseCallback callback, ArrayList newAreas) { - selectAreas(callback, newAreas, 0); - } - - public void selectAreas(SelectAreasResponseCallback callback, ArrayList newAreas, int timedInvokeTimeoutMs) { - final long commandId = 0L; - - ArrayList elements = new ArrayList<>(); - final long newAreasFieldID = 0L; - BaseTLVType newAreastlvValue = ArrayType.generateArrayType(newAreas, (elementnewAreas) -> new UIntType(elementnewAreas)); - elements.add(new StructElement(newAreasFieldID, newAreastlvValue)); - - StructType commandArgs = new StructType(elements); - invoke(new InvokeCallbackImpl(callback) { - @Override - public void onResponse(StructType invokeStructValue) { - final long statusFieldID = 0L; - Integer status = null; - final long statusTextFieldID = 1L; - String statusText = null; - for (StructElement element: invokeStructValue.value()) { - if (element.contextTagNum() == statusFieldID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - status = castingValue.value(Integer.class); - } - } else if (element.contextTagNum() == statusTextFieldID) { - if (element.value(BaseTLVType.class).type() == TLVType.String) { - StringType castingValue = element.value(StringType.class); - statusText = castingValue.value(String.class); - } - } - } - callback.onSuccess(status, statusText); - }}, commandId, commandArgs, timedInvokeTimeoutMs); - } - - public void skipArea(SkipAreaResponseCallback callback, Long skippedArea) { - skipArea(callback, skippedArea, 0); - } - - public void skipArea(SkipAreaResponseCallback callback, Long skippedArea, int timedInvokeTimeoutMs) { - final long commandId = 2L; - - ArrayList elements = new ArrayList<>(); - final long skippedAreaFieldID = 0L; - BaseTLVType skippedAreatlvValue = new UIntType(skippedArea); - elements.add(new StructElement(skippedAreaFieldID, skippedAreatlvValue)); - - StructType commandArgs = new StructType(elements); - invoke(new InvokeCallbackImpl(callback) { - @Override - public void onResponse(StructType invokeStructValue) { - final long statusFieldID = 0L; - Integer status = null; - final long statusTextFieldID = 1L; - String statusText = null; - for (StructElement element: invokeStructValue.value()) { - if (element.contextTagNum() == statusFieldID) { - if (element.value(BaseTLVType.class).type() == TLVType.UInt) { - UIntType castingValue = element.value(UIntType.class); - status = castingValue.value(Integer.class); - } - } else if (element.contextTagNum() == statusTextFieldID) { - if (element.value(BaseTLVType.class).type() == TLVType.String) { - StringType castingValue = element.value(StringType.class); - statusText = castingValue.value(String.class); - } - } - } - callback.onSuccess(status, statusText); - }}, commandId, commandArgs, timedInvokeTimeoutMs); - } - - public interface SelectAreasResponseCallback extends BaseClusterCallback { - void onSuccess(Integer status, String statusText); - } - - public interface SkipAreaResponseCallback extends BaseClusterCallback { - void onSuccess(Integer status, String statusText); - } - - public interface SupportedAreasAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface SupportedMapsAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface SelectedAreasAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface CurrentAreaAttributeCallback extends BaseAttributeCallback { - void onSuccess(@Nullable Long value); - } - - public interface EstimatedEndTimeAttributeCallback extends BaseAttributeCallback { - void onSuccess(@Nullable Long value); - } - - public interface ProgressAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface EventListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface AttributeListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public void readSupportedAreasAttribute( - SupportedAreasAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_AREAS_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, SUPPORTED_AREAS_ATTRIBUTE_ID, true); - } - - public void subscribeSupportedAreasAttribute( - SupportedAreasAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_AREAS_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, SUPPORTED_AREAS_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readSupportedMapsAttribute( - SupportedMapsAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_MAPS_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, SUPPORTED_MAPS_ATTRIBUTE_ID, true); - } - - public void subscribeSupportedMapsAttribute( - SupportedMapsAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SUPPORTED_MAPS_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, SUPPORTED_MAPS_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readSelectedAreasAttribute( - SelectedAreasAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SELECTED_AREAS_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, SELECTED_AREAS_ATTRIBUTE_ID, true); - } - - public void subscribeSelectedAreasAttribute( - SelectedAreasAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, SELECTED_AREAS_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, SELECTED_AREAS_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readCurrentAreaAttribute( - CurrentAreaAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_AREA_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, CURRENT_AREA_ATTRIBUTE_ID, true); - } - - public void subscribeCurrentAreaAttribute( - CurrentAreaAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_AREA_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, CURRENT_AREA_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readEstimatedEndTimeAttribute( - EstimatedEndTimeAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ESTIMATED_END_TIME_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ESTIMATED_END_TIME_ATTRIBUTE_ID, true); - } - - public void subscribeEstimatedEndTimeAttribute( - EstimatedEndTimeAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ESTIMATED_END_TIME_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - @Nullable Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ESTIMATED_END_TIME_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readProgressAttribute( - ProgressAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PROGRESS_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, PROGRESS_ATTRIBUTE_ID, true); - } - - public void subscribeProgressAttribute( - ProgressAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PROGRESS_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, PROGRESS_ATTRIBUTE_ID, minInterval, maxInterval); + }, PROGRESS_ATTRIBUTE_ID, minInterval, maxInterval); } public void readGeneratedCommandListAttribute( @@ -61366,3771 +60067,6 @@ public void onSuccess(byte[] tlv) { } } - public static class ElectricalMeasurementCluster extends BaseChipCluster { - public static final long CLUSTER_ID = 2820L; - - private static final long MEASUREMENT_TYPE_ATTRIBUTE_ID = 0L; - private static final long DC_VOLTAGE_ATTRIBUTE_ID = 256L; - private static final long DC_VOLTAGE_MIN_ATTRIBUTE_ID = 257L; - private static final long DC_VOLTAGE_MAX_ATTRIBUTE_ID = 258L; - private static final long DC_CURRENT_ATTRIBUTE_ID = 259L; - private static final long DC_CURRENT_MIN_ATTRIBUTE_ID = 260L; - private static final long DC_CURRENT_MAX_ATTRIBUTE_ID = 261L; - private static final long DC_POWER_ATTRIBUTE_ID = 262L; - private static final long DC_POWER_MIN_ATTRIBUTE_ID = 263L; - private static final long DC_POWER_MAX_ATTRIBUTE_ID = 264L; - private static final long DC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID = 512L; - private static final long DC_VOLTAGE_DIVISOR_ATTRIBUTE_ID = 513L; - private static final long DC_CURRENT_MULTIPLIER_ATTRIBUTE_ID = 514L; - private static final long DC_CURRENT_DIVISOR_ATTRIBUTE_ID = 515L; - private static final long DC_POWER_MULTIPLIER_ATTRIBUTE_ID = 516L; - private static final long DC_POWER_DIVISOR_ATTRIBUTE_ID = 517L; - private static final long AC_FREQUENCY_ATTRIBUTE_ID = 768L; - private static final long AC_FREQUENCY_MIN_ATTRIBUTE_ID = 769L; - private static final long AC_FREQUENCY_MAX_ATTRIBUTE_ID = 770L; - private static final long NEUTRAL_CURRENT_ATTRIBUTE_ID = 771L; - private static final long TOTAL_ACTIVE_POWER_ATTRIBUTE_ID = 772L; - private static final long TOTAL_REACTIVE_POWER_ATTRIBUTE_ID = 773L; - private static final long TOTAL_APPARENT_POWER_ATTRIBUTE_ID = 774L; - private static final long MEASURED1ST_HARMONIC_CURRENT_ATTRIBUTE_ID = 775L; - private static final long MEASURED3RD_HARMONIC_CURRENT_ATTRIBUTE_ID = 776L; - private static final long MEASURED5TH_HARMONIC_CURRENT_ATTRIBUTE_ID = 777L; - private static final long MEASURED7TH_HARMONIC_CURRENT_ATTRIBUTE_ID = 778L; - private static final long MEASURED9TH_HARMONIC_CURRENT_ATTRIBUTE_ID = 779L; - private static final long MEASURED11TH_HARMONIC_CURRENT_ATTRIBUTE_ID = 780L; - private static final long MEASURED_PHASE1ST_HARMONIC_CURRENT_ATTRIBUTE_ID = 781L; - private static final long MEASURED_PHASE3RD_HARMONIC_CURRENT_ATTRIBUTE_ID = 782L; - private static final long MEASURED_PHASE5TH_HARMONIC_CURRENT_ATTRIBUTE_ID = 783L; - private static final long MEASURED_PHASE7TH_HARMONIC_CURRENT_ATTRIBUTE_ID = 784L; - private static final long MEASURED_PHASE9TH_HARMONIC_CURRENT_ATTRIBUTE_ID = 785L; - private static final long MEASURED_PHASE11TH_HARMONIC_CURRENT_ATTRIBUTE_ID = 786L; - private static final long AC_FREQUENCY_MULTIPLIER_ATTRIBUTE_ID = 1024L; - private static final long AC_FREQUENCY_DIVISOR_ATTRIBUTE_ID = 1025L; - private static final long POWER_MULTIPLIER_ATTRIBUTE_ID = 1026L; - private static final long POWER_DIVISOR_ATTRIBUTE_ID = 1027L; - private static final long HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID = 1028L; - private static final long PHASE_HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID = 1029L; - private static final long INSTANTANEOUS_VOLTAGE_ATTRIBUTE_ID = 1280L; - private static final long INSTANTANEOUS_LINE_CURRENT_ATTRIBUTE_ID = 1281L; - private static final long INSTANTANEOUS_ACTIVE_CURRENT_ATTRIBUTE_ID = 1282L; - private static final long INSTANTANEOUS_REACTIVE_CURRENT_ATTRIBUTE_ID = 1283L; - private static final long INSTANTANEOUS_POWER_ATTRIBUTE_ID = 1284L; - private static final long RMS_VOLTAGE_ATTRIBUTE_ID = 1285L; - private static final long RMS_VOLTAGE_MIN_ATTRIBUTE_ID = 1286L; - private static final long RMS_VOLTAGE_MAX_ATTRIBUTE_ID = 1287L; - private static final long RMS_CURRENT_ATTRIBUTE_ID = 1288L; - private static final long RMS_CURRENT_MIN_ATTRIBUTE_ID = 1289L; - private static final long RMS_CURRENT_MAX_ATTRIBUTE_ID = 1290L; - private static final long ACTIVE_POWER_ATTRIBUTE_ID = 1291L; - private static final long ACTIVE_POWER_MIN_ATTRIBUTE_ID = 1292L; - private static final long ACTIVE_POWER_MAX_ATTRIBUTE_ID = 1293L; - private static final long REACTIVE_POWER_ATTRIBUTE_ID = 1294L; - private static final long APPARENT_POWER_ATTRIBUTE_ID = 1295L; - private static final long POWER_FACTOR_ATTRIBUTE_ID = 1296L; - private static final long AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID = 1297L; - private static final long AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID = 1299L; - private static final long RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID = 1300L; - private static final long RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID = 1301L; - private static final long RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID = 1302L; - private static final long RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID = 1303L; - private static final long AC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID = 1536L; - private static final long AC_VOLTAGE_DIVISOR_ATTRIBUTE_ID = 1537L; - private static final long AC_CURRENT_MULTIPLIER_ATTRIBUTE_ID = 1538L; - private static final long AC_CURRENT_DIVISOR_ATTRIBUTE_ID = 1539L; - private static final long AC_POWER_MULTIPLIER_ATTRIBUTE_ID = 1540L; - private static final long AC_POWER_DIVISOR_ATTRIBUTE_ID = 1541L; - private static final long OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID = 1792L; - private static final long VOLTAGE_OVERLOAD_ATTRIBUTE_ID = 1793L; - private static final long CURRENT_OVERLOAD_ATTRIBUTE_ID = 1794L; - private static final long AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID = 2048L; - private static final long AC_VOLTAGE_OVERLOAD_ATTRIBUTE_ID = 2049L; - private static final long AC_CURRENT_OVERLOAD_ATTRIBUTE_ID = 2050L; - private static final long AC_ACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID = 2051L; - private static final long AC_REACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID = 2052L; - private static final long AVERAGE_RMS_OVER_VOLTAGE_ATTRIBUTE_ID = 2053L; - private static final long AVERAGE_RMS_UNDER_VOLTAGE_ATTRIBUTE_ID = 2054L; - private static final long RMS_EXTREME_OVER_VOLTAGE_ATTRIBUTE_ID = 2055L; - private static final long RMS_EXTREME_UNDER_VOLTAGE_ATTRIBUTE_ID = 2056L; - private static final long RMS_VOLTAGE_SAG_ATTRIBUTE_ID = 2057L; - private static final long RMS_VOLTAGE_SWELL_ATTRIBUTE_ID = 2058L; - private static final long LINE_CURRENT_PHASE_B_ATTRIBUTE_ID = 2305L; - private static final long ACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID = 2306L; - private static final long REACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID = 2307L; - private static final long RMS_VOLTAGE_PHASE_B_ATTRIBUTE_ID = 2309L; - private static final long RMS_VOLTAGE_MIN_PHASE_B_ATTRIBUTE_ID = 2310L; - private static final long RMS_VOLTAGE_MAX_PHASE_B_ATTRIBUTE_ID = 2311L; - private static final long RMS_CURRENT_PHASE_B_ATTRIBUTE_ID = 2312L; - private static final long RMS_CURRENT_MIN_PHASE_B_ATTRIBUTE_ID = 2313L; - private static final long RMS_CURRENT_MAX_PHASE_B_ATTRIBUTE_ID = 2314L; - private static final long ACTIVE_POWER_PHASE_B_ATTRIBUTE_ID = 2315L; - private static final long ACTIVE_POWER_MIN_PHASE_B_ATTRIBUTE_ID = 2316L; - private static final long ACTIVE_POWER_MAX_PHASE_B_ATTRIBUTE_ID = 2317L; - private static final long REACTIVE_POWER_PHASE_B_ATTRIBUTE_ID = 2318L; - private static final long APPARENT_POWER_PHASE_B_ATTRIBUTE_ID = 2319L; - private static final long POWER_FACTOR_PHASE_B_ATTRIBUTE_ID = 2320L; - private static final long AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_B_ATTRIBUTE_ID = 2321L; - private static final long AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID = 2322L; - private static final long AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID = 2323L; - private static final long RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID = 2324L; - private static final long RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID = 2325L; - private static final long RMS_VOLTAGE_SAG_PERIOD_PHASE_B_ATTRIBUTE_ID = 2326L; - private static final long RMS_VOLTAGE_SWELL_PERIOD_PHASE_B_ATTRIBUTE_ID = 2327L; - private static final long LINE_CURRENT_PHASE_C_ATTRIBUTE_ID = 2561L; - private static final long ACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID = 2562L; - private static final long REACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID = 2563L; - private static final long RMS_VOLTAGE_PHASE_C_ATTRIBUTE_ID = 2565L; - private static final long RMS_VOLTAGE_MIN_PHASE_C_ATTRIBUTE_ID = 2566L; - private static final long RMS_VOLTAGE_MAX_PHASE_C_ATTRIBUTE_ID = 2567L; - private static final long RMS_CURRENT_PHASE_C_ATTRIBUTE_ID = 2568L; - private static final long RMS_CURRENT_MIN_PHASE_C_ATTRIBUTE_ID = 2569L; - private static final long RMS_CURRENT_MAX_PHASE_C_ATTRIBUTE_ID = 2570L; - private static final long ACTIVE_POWER_PHASE_C_ATTRIBUTE_ID = 2571L; - private static final long ACTIVE_POWER_MIN_PHASE_C_ATTRIBUTE_ID = 2572L; - private static final long ACTIVE_POWER_MAX_PHASE_C_ATTRIBUTE_ID = 2573L; - private static final long REACTIVE_POWER_PHASE_C_ATTRIBUTE_ID = 2574L; - private static final long APPARENT_POWER_PHASE_C_ATTRIBUTE_ID = 2575L; - private static final long POWER_FACTOR_PHASE_C_ATTRIBUTE_ID = 2576L; - private static final long AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_C_ATTRIBUTE_ID = 2577L; - private static final long AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID = 2578L; - private static final long AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID = 2579L; - private static final long RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID = 2580L; - private static final long RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID = 2581L; - private static final long RMS_VOLTAGE_SAG_PERIOD_PHASE_C_ATTRIBUTE_ID = 2582L; - private static final long RMS_VOLTAGE_SWELL_PERIOD_PHASE_C_ATTRIBUTE_ID = 2583L; - private static final long GENERATED_COMMAND_LIST_ATTRIBUTE_ID = 65528L; - private static final long ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID = 65529L; - private static final long EVENT_LIST_ATTRIBUTE_ID = 65530L; - private static final long ATTRIBUTE_LIST_ATTRIBUTE_ID = 65531L; - private static final long FEATURE_MAP_ATTRIBUTE_ID = 65532L; - private static final long CLUSTER_REVISION_ATTRIBUTE_ID = 65533L; - - public ElectricalMeasurementCluster(long devicePtr, int endpointId) { - super(devicePtr, endpointId, CLUSTER_ID); - } - - @Override - @Deprecated - public long initWithDevice(long devicePtr, int endpointId) { - return 0L; - } - - public void getProfileInfoCommand(DefaultClusterCallback callback) { - getProfileInfoCommand(callback, 0); - } - - public void getProfileInfoCommand(DefaultClusterCallback callback, int timedInvokeTimeoutMs) { - final long commandId = 0L; - - ArrayList elements = new ArrayList<>(); - StructType commandArgs = new StructType(elements); - invoke(new InvokeCallbackImpl(callback) { - @Override - public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); - }}, commandId, commandArgs, timedInvokeTimeoutMs); - } - - public void getMeasurementProfileCommand(DefaultClusterCallback callback, Integer attributeId, Long startTime, Integer numberOfIntervals) { - getMeasurementProfileCommand(callback, attributeId, startTime, numberOfIntervals, 0); - } - - public void getMeasurementProfileCommand(DefaultClusterCallback callback, Integer attributeId, Long startTime, Integer numberOfIntervals, int timedInvokeTimeoutMs) { - final long commandId = 1L; - - ArrayList elements = new ArrayList<>(); - final long attributeIdFieldID = 0L; - BaseTLVType attributeIdtlvValue = new UIntType(attributeId); - elements.add(new StructElement(attributeIdFieldID, attributeIdtlvValue)); - - final long startTimeFieldID = 1L; - BaseTLVType startTimetlvValue = new UIntType(startTime); - elements.add(new StructElement(startTimeFieldID, startTimetlvValue)); - - final long numberOfIntervalsFieldID = 2L; - BaseTLVType numberOfIntervalstlvValue = new UIntType(numberOfIntervals); - elements.add(new StructElement(numberOfIntervalsFieldID, numberOfIntervalstlvValue)); - - StructType commandArgs = new StructType(elements); - invoke(new InvokeCallbackImpl(callback) { - @Override - public void onResponse(StructType invokeStructValue) { - callback.onSuccess(); - }}, commandId, commandArgs, timedInvokeTimeoutMs); - } - - public interface GeneratedCommandListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface AcceptedCommandListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface EventListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public interface AttributeListAttributeCallback extends BaseAttributeCallback { - void onSuccess(List value); - } - - public void readMeasurementTypeAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASUREMENT_TYPE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASUREMENT_TYPE_ATTRIBUTE_ID, true); - } - - public void subscribeMeasurementTypeAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASUREMENT_TYPE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASUREMENT_TYPE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDcVoltageAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_VOLTAGE_ATTRIBUTE_ID, true); - } - - public void subscribeDcVoltageAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDcVoltageMinAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MIN_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_VOLTAGE_MIN_ATTRIBUTE_ID, true); - } - - public void subscribeDcVoltageMinAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MIN_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_VOLTAGE_MIN_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDcVoltageMaxAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MAX_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_VOLTAGE_MAX_ATTRIBUTE_ID, true); - } - - public void subscribeDcVoltageMaxAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MAX_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_VOLTAGE_MAX_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDcCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeDcCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDcCurrentMinAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MIN_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_CURRENT_MIN_ATTRIBUTE_ID, true); - } - - public void subscribeDcCurrentMinAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MIN_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_CURRENT_MIN_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDcCurrentMaxAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MAX_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_CURRENT_MAX_ATTRIBUTE_ID, true); - } - - public void subscribeDcCurrentMaxAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MAX_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_CURRENT_MAX_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDcPowerAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_POWER_ATTRIBUTE_ID, true); - } - - public void subscribeDcPowerAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_POWER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDcPowerMinAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MIN_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_POWER_MIN_ATTRIBUTE_ID, true); - } - - public void subscribeDcPowerMinAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MIN_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_POWER_MIN_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDcPowerMaxAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MAX_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_POWER_MAX_ATTRIBUTE_ID, true); - } - - public void subscribeDcPowerMaxAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MAX_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_POWER_MAX_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDcVoltageMultiplierAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID, true); - } - - public void subscribeDcVoltageMultiplierAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDcVoltageDivisorAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_DIVISOR_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_VOLTAGE_DIVISOR_ATTRIBUTE_ID, true); - } - - public void subscribeDcVoltageDivisorAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_VOLTAGE_DIVISOR_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_VOLTAGE_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDcCurrentMultiplierAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, true); - } - - public void subscribeDcCurrentMultiplierAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDcCurrentDivisorAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_DIVISOR_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_CURRENT_DIVISOR_ATTRIBUTE_ID, true); - } - - public void subscribeDcCurrentDivisorAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_CURRENT_DIVISOR_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_CURRENT_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDcPowerMultiplierAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MULTIPLIER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_POWER_MULTIPLIER_ATTRIBUTE_ID, true); - } - - public void subscribeDcPowerMultiplierAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_MULTIPLIER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_POWER_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readDcPowerDivisorAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_DIVISOR_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_POWER_DIVISOR_ATTRIBUTE_ID, true); - } - - public void subscribeDcPowerDivisorAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, DC_POWER_DIVISOR_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, DC_POWER_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcFrequencyAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_FREQUENCY_ATTRIBUTE_ID, true); - } - - public void subscribeAcFrequencyAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_FREQUENCY_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcFrequencyMinAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MIN_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_FREQUENCY_MIN_ATTRIBUTE_ID, true); - } - - public void subscribeAcFrequencyMinAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MIN_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_FREQUENCY_MIN_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcFrequencyMaxAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MAX_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_FREQUENCY_MAX_ATTRIBUTE_ID, true); - } - - public void subscribeAcFrequencyMaxAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MAX_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_FREQUENCY_MAX_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readNeutralCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEUTRAL_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, NEUTRAL_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeNeutralCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, NEUTRAL_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, NEUTRAL_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readTotalActivePowerAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_ACTIVE_POWER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, TOTAL_ACTIVE_POWER_ATTRIBUTE_ID, true); - } - - public void subscribeTotalActivePowerAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_ACTIVE_POWER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, TOTAL_ACTIVE_POWER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readTotalReactivePowerAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_REACTIVE_POWER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, TOTAL_REACTIVE_POWER_ATTRIBUTE_ID, true); - } - - public void subscribeTotalReactivePowerAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_REACTIVE_POWER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, TOTAL_REACTIVE_POWER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readTotalApparentPowerAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_APPARENT_POWER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, TOTAL_APPARENT_POWER_ATTRIBUTE_ID, true); - } - - public void subscribeTotalApparentPowerAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, TOTAL_APPARENT_POWER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, TOTAL_APPARENT_POWER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readMeasured1stHarmonicCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED1ST_HARMONIC_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED1ST_HARMONIC_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeMeasured1stHarmonicCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED1ST_HARMONIC_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED1ST_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readMeasured3rdHarmonicCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED3RD_HARMONIC_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED3RD_HARMONIC_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeMeasured3rdHarmonicCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED3RD_HARMONIC_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED3RD_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readMeasured5thHarmonicCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED5TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED5TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeMeasured5thHarmonicCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED5TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED5TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readMeasured7thHarmonicCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED7TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED7TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeMeasured7thHarmonicCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED7TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED7TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readMeasured9thHarmonicCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED9TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED9TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeMeasured9thHarmonicCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED9TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED9TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readMeasured11thHarmonicCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED11TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED11TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeMeasured11thHarmonicCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED11TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED11TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readMeasuredPhase1stHarmonicCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE1ST_HARMONIC_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED_PHASE1ST_HARMONIC_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeMeasuredPhase1stHarmonicCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE1ST_HARMONIC_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED_PHASE1ST_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readMeasuredPhase3rdHarmonicCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE3RD_HARMONIC_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED_PHASE3RD_HARMONIC_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeMeasuredPhase3rdHarmonicCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE3RD_HARMONIC_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED_PHASE3RD_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readMeasuredPhase5thHarmonicCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE5TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED_PHASE5TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeMeasuredPhase5thHarmonicCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE5TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED_PHASE5TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readMeasuredPhase7thHarmonicCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE7TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED_PHASE7TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeMeasuredPhase7thHarmonicCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE7TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED_PHASE7TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readMeasuredPhase9thHarmonicCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE9TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED_PHASE9TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeMeasuredPhase9thHarmonicCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE9TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED_PHASE9TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readMeasuredPhase11thHarmonicCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE11TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED_PHASE11TH_HARMONIC_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeMeasuredPhase11thHarmonicCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, MEASURED_PHASE11TH_HARMONIC_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, MEASURED_PHASE11TH_HARMONIC_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcFrequencyMultiplierAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MULTIPLIER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_FREQUENCY_MULTIPLIER_ATTRIBUTE_ID, true); - } - - public void subscribeAcFrequencyMultiplierAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_MULTIPLIER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_FREQUENCY_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcFrequencyDivisorAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_DIVISOR_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_FREQUENCY_DIVISOR_ATTRIBUTE_ID, true); - } - - public void subscribeAcFrequencyDivisorAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_FREQUENCY_DIVISOR_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_FREQUENCY_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readPowerMultiplierAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_MULTIPLIER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, POWER_MULTIPLIER_ATTRIBUTE_ID, true); - } - - public void subscribePowerMultiplierAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_MULTIPLIER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, POWER_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readPowerDivisorAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_DIVISOR_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, POWER_DIVISOR_ATTRIBUTE_ID, true); - } - - public void subscribePowerDivisorAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_DIVISOR_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, POWER_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readHarmonicCurrentMultiplierAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, true); - } - - public void subscribeHarmonicCurrentMultiplierAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readPhaseHarmonicCurrentMultiplierAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PHASE_HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, PHASE_HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, true); - } - - public void subscribePhaseHarmonicCurrentMultiplierAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, PHASE_HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, PHASE_HARMONIC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readInstantaneousVoltageAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_VOLTAGE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, INSTANTANEOUS_VOLTAGE_ATTRIBUTE_ID, true); - } - - public void subscribeInstantaneousVoltageAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_VOLTAGE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, INSTANTANEOUS_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readInstantaneousLineCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_LINE_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, INSTANTANEOUS_LINE_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeInstantaneousLineCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_LINE_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, INSTANTANEOUS_LINE_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readInstantaneousActiveCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_ACTIVE_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, INSTANTANEOUS_ACTIVE_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeInstantaneousActiveCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_ACTIVE_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, INSTANTANEOUS_ACTIVE_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readInstantaneousReactiveCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_REACTIVE_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, INSTANTANEOUS_REACTIVE_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeInstantaneousReactiveCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_REACTIVE_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, INSTANTANEOUS_REACTIVE_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readInstantaneousPowerAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_POWER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, INSTANTANEOUS_POWER_ATTRIBUTE_ID, true); - } - - public void subscribeInstantaneousPowerAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, INSTANTANEOUS_POWER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, INSTANTANEOUS_POWER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltageAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_ATTRIBUTE_ID, true); - } - - public void subscribeRmsVoltageAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltageMinAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_MIN_ATTRIBUTE_ID, true); - } - - public void subscribeRmsVoltageMinAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_MIN_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltageMaxAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_MAX_ATTRIBUTE_ID, true); - } - - public void subscribeRmsVoltageMaxAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_MAX_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsCurrentAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_ATTRIBUTE_ID, true); - } - - public void subscribeRmsCurrentAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsCurrentMinAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_MIN_ATTRIBUTE_ID, true); - } - - public void subscribeRmsCurrentMinAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_MIN_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsCurrentMaxAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_MAX_ATTRIBUTE_ID, true); - } - - public void subscribeRmsCurrentMaxAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_MAX_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readActivePowerAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_ATTRIBUTE_ID, true); - } - - public void subscribeActivePowerAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readActivePowerMinAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_MIN_ATTRIBUTE_ID, true); - } - - public void subscribeActivePowerMinAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_MIN_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readActivePowerMaxAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_MAX_ATTRIBUTE_ID, true); - } - - public void subscribeActivePowerMaxAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_MAX_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readReactivePowerAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, REACTIVE_POWER_ATTRIBUTE_ID, true); - } - - public void subscribeReactivePowerAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, REACTIVE_POWER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readApparentPowerAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, APPARENT_POWER_ATTRIBUTE_ID, true); - } - - public void subscribeApparentPowerAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, APPARENT_POWER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readPowerFactorAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, POWER_FACTOR_ATTRIBUTE_ID, true); - } - - public void subscribePowerFactorAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, POWER_FACTOR_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAverageRmsVoltageMeasurementPeriodAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID, true); - } - - public void writeAverageRmsVoltageMeasurementPeriodAttribute(DefaultClusterCallback callback, Integer value) { - writeAverageRmsVoltageMeasurementPeriodAttribute(callback, value, 0); - } - - public void writeAverageRmsVoltageMeasurementPeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeAverageRmsVoltageMeasurementPeriodAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAverageRmsUnderVoltageCounterAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID, true); - } - - public void writeAverageRmsUnderVoltageCounterAttribute(DefaultClusterCallback callback, Integer value) { - writeAverageRmsUnderVoltageCounterAttribute(callback, value, 0); - } - - public void writeAverageRmsUnderVoltageCounterAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeAverageRmsUnderVoltageCounterAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsExtremeOverVoltagePeriodAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID, true); - } - - public void writeRmsExtremeOverVoltagePeriodAttribute(DefaultClusterCallback callback, Integer value) { - writeRmsExtremeOverVoltagePeriodAttribute(callback, value, 0); - } - - public void writeRmsExtremeOverVoltagePeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeRmsExtremeOverVoltagePeriodAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsExtremeUnderVoltagePeriodAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID, true); - } - - public void writeRmsExtremeUnderVoltagePeriodAttribute(DefaultClusterCallback callback, Integer value) { - writeRmsExtremeUnderVoltagePeriodAttribute(callback, value, 0); - } - - public void writeRmsExtremeUnderVoltagePeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeRmsExtremeUnderVoltagePeriodAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltageSagPeriodAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID, true); - } - - public void writeRmsVoltageSagPeriodAttribute(DefaultClusterCallback callback, Integer value) { - writeRmsVoltageSagPeriodAttribute(callback, value, 0); - } - - public void writeRmsVoltageSagPeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeRmsVoltageSagPeriodAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SAG_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltageSwellPeriodAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID, true); - } - - public void writeRmsVoltageSwellPeriodAttribute(DefaultClusterCallback callback, Integer value) { - writeRmsVoltageSwellPeriodAttribute(callback, value, 0); - } - - public void writeRmsVoltageSwellPeriodAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeRmsVoltageSwellPeriodAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SWELL_PERIOD_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcVoltageMultiplierAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID, true); - } - - public void subscribeAcVoltageMultiplierAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_VOLTAGE_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcVoltageDivisorAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_DIVISOR_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_VOLTAGE_DIVISOR_ATTRIBUTE_ID, true); - } - - public void subscribeAcVoltageDivisorAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_DIVISOR_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_VOLTAGE_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcCurrentMultiplierAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, true); - } - - public void subscribeAcCurrentMultiplierAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_MULTIPLIER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_CURRENT_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcCurrentDivisorAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_DIVISOR_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_CURRENT_DIVISOR_ATTRIBUTE_ID, true); - } - - public void subscribeAcCurrentDivisorAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_DIVISOR_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_CURRENT_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcPowerMultiplierAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_POWER_MULTIPLIER_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_POWER_MULTIPLIER_ATTRIBUTE_ID, true); - } - - public void subscribeAcPowerMultiplierAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_POWER_MULTIPLIER_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_POWER_MULTIPLIER_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcPowerDivisorAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_POWER_DIVISOR_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_POWER_DIVISOR_ATTRIBUTE_ID, true); - } - - public void subscribeAcPowerDivisorAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_POWER_DIVISOR_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_POWER_DIVISOR_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readOverloadAlarmsMaskAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, true); - } - - public void writeOverloadAlarmsMaskAttribute(DefaultClusterCallback callback, Integer value) { - writeOverloadAlarmsMaskAttribute(callback, value, 0); - } - - public void writeOverloadAlarmsMaskAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeOverloadAlarmsMaskAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readVoltageOverloadAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VOLTAGE_OVERLOAD_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, VOLTAGE_OVERLOAD_ATTRIBUTE_ID, true); - } - - public void subscribeVoltageOverloadAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, VOLTAGE_OVERLOAD_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, VOLTAGE_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readCurrentOverloadAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_OVERLOAD_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, CURRENT_OVERLOAD_ATTRIBUTE_ID, true); - } - - public void subscribeCurrentOverloadAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CURRENT_OVERLOAD_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, CURRENT_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcOverloadAlarmsMaskAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, true); - } - - public void writeAcOverloadAlarmsMaskAttribute(DefaultClusterCallback callback, Integer value) { - writeAcOverloadAlarmsMaskAttribute(callback, value, 0); - } - - public void writeAcOverloadAlarmsMaskAttribute(DefaultClusterCallback callback, Integer value, int timedWriteTimeoutMs) { - BaseTLVType tlvValue = new UIntType(value); - writeAttribute(new WriteAttributesCallbackImpl(callback), AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, tlvValue, timedWriteTimeoutMs); - } - - public void subscribeAcOverloadAlarmsMaskAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_OVERLOAD_ALARMS_MASK_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcVoltageOverloadAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_OVERLOAD_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_VOLTAGE_OVERLOAD_ATTRIBUTE_ID, true); - } - - public void subscribeAcVoltageOverloadAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_VOLTAGE_OVERLOAD_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_VOLTAGE_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcCurrentOverloadAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_OVERLOAD_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_CURRENT_OVERLOAD_ATTRIBUTE_ID, true); - } - - public void subscribeAcCurrentOverloadAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_CURRENT_OVERLOAD_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_CURRENT_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcActivePowerOverloadAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_ACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_ACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID, true); - } - - public void subscribeAcActivePowerOverloadAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_ACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_ACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcReactivePowerOverloadAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_REACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_REACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID, true); - } - - public void subscribeAcReactivePowerOverloadAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AC_REACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AC_REACTIVE_POWER_OVERLOAD_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAverageRmsOverVoltageAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_OVER_VOLTAGE_ATTRIBUTE_ID, true); - } - - public void subscribeAverageRmsOverVoltageAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_OVER_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAverageRmsUnderVoltageAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_UNDER_VOLTAGE_ATTRIBUTE_ID, true); - } - - public void subscribeAverageRmsUnderVoltageAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_UNDER_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsExtremeOverVoltageAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_OVER_VOLTAGE_ATTRIBUTE_ID, true); - } - - public void subscribeRmsExtremeOverVoltageAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_OVER_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsExtremeUnderVoltageAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_UNDER_VOLTAGE_ATTRIBUTE_ID, true); - } - - public void subscribeRmsExtremeUnderVoltageAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_UNDER_VOLTAGE_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltageSagAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SAG_ATTRIBUTE_ID, true); - } - - public void subscribeRmsVoltageSagAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SAG_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltageSwellAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SWELL_ATTRIBUTE_ID, true); - } - - public void subscribeRmsVoltageSwellAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SWELL_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readLineCurrentPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LINE_CURRENT_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, LINE_CURRENT_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeLineCurrentPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LINE_CURRENT_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, LINE_CURRENT_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readActiveCurrentPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeActiveCurrentPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readReactiveCurrentPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, REACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeReactiveCurrentPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, REACTIVE_CURRENT_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltagePhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeRmsVoltagePhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltageMinPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_MIN_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeRmsVoltageMinPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_MIN_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltageMaxPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_MAX_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeRmsVoltageMaxPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_MAX_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsCurrentPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeRmsCurrentPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsCurrentMinPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_MIN_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeRmsCurrentMinPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_MIN_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsCurrentMaxPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_MAX_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeRmsCurrentMaxPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_MAX_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readActivePowerPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeActivePowerPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readActivePowerMinPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_MIN_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeActivePowerMinPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_MIN_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readActivePowerMaxPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_MAX_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeActivePowerMaxPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_MAX_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readReactivePowerPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, REACTIVE_POWER_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeReactivePowerPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, REACTIVE_POWER_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readApparentPowerPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, APPARENT_POWER_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeApparentPowerPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, APPARENT_POWER_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readPowerFactorPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, POWER_FACTOR_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribePowerFactorPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, POWER_FACTOR_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAverageRmsVoltageMeasurementPeriodPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeAverageRmsVoltageMeasurementPeriodPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAverageRmsOverVoltageCounterPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeAverageRmsOverVoltageCounterPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAverageRmsUnderVoltageCounterPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeAverageRmsUnderVoltageCounterPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsExtremeOverVoltagePeriodPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeRmsExtremeOverVoltagePeriodPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsExtremeUnderVoltagePeriodPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeRmsExtremeUnderVoltagePeriodPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltageSagPeriodPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SAG_PERIOD_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeRmsVoltageSagPeriodPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SAG_PERIOD_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltageSwellPeriodPhaseBAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_PHASE_B_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SWELL_PERIOD_PHASE_B_ATTRIBUTE_ID, true); - } - - public void subscribeRmsVoltageSwellPeriodPhaseBAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_PHASE_B_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SWELL_PERIOD_PHASE_B_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readLineCurrentPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LINE_CURRENT_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, LINE_CURRENT_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeLineCurrentPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, LINE_CURRENT_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, LINE_CURRENT_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readActiveCurrentPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeActiveCurrentPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readReactiveCurrentPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, REACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeReactiveCurrentPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, REACTIVE_CURRENT_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltagePhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeRmsVoltagePhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltageMinPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_MIN_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeRmsVoltageMinPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MIN_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_MIN_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltageMaxPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_MAX_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeRmsVoltageMaxPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_MAX_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_MAX_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsCurrentPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeRmsCurrentPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsCurrentMinPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_MIN_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeRmsCurrentMinPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MIN_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_MIN_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsCurrentMaxPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_MAX_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeRmsCurrentMaxPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_CURRENT_MAX_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_CURRENT_MAX_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readActivePowerPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeActivePowerPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readActivePowerMinPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_MIN_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeActivePowerMinPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MIN_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_MIN_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readActivePowerMaxPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_MAX_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeActivePowerMaxPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACTIVE_POWER_MAX_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACTIVE_POWER_MAX_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readReactivePowerPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, REACTIVE_POWER_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeReactivePowerPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, REACTIVE_POWER_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, REACTIVE_POWER_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readApparentPowerPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, APPARENT_POWER_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeApparentPowerPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, APPARENT_POWER_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, APPARENT_POWER_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readPowerFactorPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, POWER_FACTOR_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribePowerFactorPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, POWER_FACTOR_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, POWER_FACTOR_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAverageRmsVoltageMeasurementPeriodPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeAverageRmsVoltageMeasurementPeriodPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_VOLTAGE_MEASUREMENT_PERIOD_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAverageRmsOverVoltageCounterPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeAverageRmsOverVoltageCounterPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_OVER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAverageRmsUnderVoltageCounterPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeAverageRmsUnderVoltageCounterPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, AVERAGE_RMS_UNDER_VOLTAGE_COUNTER_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsExtremeOverVoltagePeriodPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeRmsExtremeOverVoltagePeriodPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_OVER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsExtremeUnderVoltagePeriodPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeRmsExtremeUnderVoltagePeriodPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_EXTREME_UNDER_VOLTAGE_PERIOD_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltageSagPeriodPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SAG_PERIOD_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeRmsVoltageSagPeriodPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SAG_PERIOD_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SAG_PERIOD_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readRmsVoltageSwellPeriodPhaseCAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_PHASE_C_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SWELL_PERIOD_PHASE_C_ATTRIBUTE_ID, true); - } - - public void subscribeRmsVoltageSwellPeriodPhaseCAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, RMS_VOLTAGE_SWELL_PERIOD_PHASE_C_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, RMS_VOLTAGE_SWELL_PERIOD_PHASE_C_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeGeneratedCommandListAttribute( - GeneratedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, GENERATED_COMMAND_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, GENERATED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAcceptedCommandListAttribute( - AcceptedCommandListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeAcceptedCommandListAttribute( - AcceptedCommandListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ACCEPTED_COMMAND_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readEventListAttribute( - EventListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, EVENT_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeEventListAttribute( - EventListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, EVENT_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, EVENT_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readAttributeListAttribute( - AttributeListAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ATTRIBUTE_LIST_ATTRIBUTE_ID, true); - } - - public void subscribeAttributeListAttribute( - AttributeListAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, ATTRIBUTE_LIST_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - List value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, ATTRIBUTE_LIST_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readFeatureMapAttribute( - LongAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, FEATURE_MAP_ATTRIBUTE_ID, true); - } - - public void subscribeFeatureMapAttribute( - LongAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, FEATURE_MAP_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Long value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, FEATURE_MAP_ATTRIBUTE_ID, minInterval, maxInterval); - } - - public void readClusterRevisionAttribute( - IntegerAttributeCallback callback) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); - - readAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, CLUSTER_REVISION_ATTRIBUTE_ID, true); - } - - public void subscribeClusterRevisionAttribute( - IntegerAttributeCallback callback, int minInterval, int maxInterval) { - ChipAttributePath path = ChipAttributePath.newInstance(endpointId, clusterId, CLUSTER_REVISION_ATTRIBUTE_ID); - - subscribeAttribute(new ReportCallbackImpl(callback, path) { - @Override - public void onSuccess(byte[] tlv) { - Integer value = ChipTLVValueDecoder.decodeAttributeValue(path, tlv); - callback.onSuccess(value); - } - }, CLUSTER_REVISION_ATTRIBUTE_ID, minInterval, maxInterval); - } - } - public static class UnitTestingCluster extends BaseChipCluster { public static final long CLUSTER_ID = 4294048773L; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java index 950e6070dff2c0..8bf4e6d615c358 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterIDMapping.java @@ -37,15 +37,9 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == OnOff.ID) { return new OnOff(); } - if (clusterId == OnOffSwitchConfiguration.ID) { - return new OnOffSwitchConfiguration(); - } if (clusterId == LevelControl.ID) { return new LevelControl(); } - if (clusterId == BinaryInputBasic.ID) { - return new BinaryInputBasic(); - } if (clusterId == PulseWidthModulation.ID) { return new PulseWidthModulation(); } @@ -265,9 +259,6 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == WindowCovering.ID) { return new WindowCovering(); } - if (clusterId == BarrierControl.ID) { - return new BarrierControl(); - } if (clusterId == ServiceArea.ID) { return new ServiceArea(); } @@ -394,9 +385,6 @@ public static BaseCluster getCluster(long clusterId) { if (clusterId == CommissionerControl.ID) { return new CommissionerControl(); } - if (clusterId == ElectricalMeasurement.ID) { - return new ElectricalMeasurement(); - } if (clusterId == UnitTesting.ID) { return new UnitTesting(); } @@ -882,108 +870,6 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class OnOffSwitchConfiguration implements BaseCluster { - public static final long ID = 7L; - public long getID() { - return ID; - } - - public enum Attribute { - SwitchType(0L), - SwitchActions(16L), - GeneratedCommandList(65528L), - AcceptedCommandList(65529L), - EventList(65530L), - AttributeList(65531L), - FeatureMap(65532L), - ClusterRevision(65533L),; - private final long id; - Attribute(long id) { - this.id = id; - } - - public long getID() { - return id; - } - - public static Attribute value(long id) throws NoSuchFieldError { - for (Attribute attribute : Attribute.values()) { - if (attribute.getID() == id) { - return attribute; - } - } - throw new NoSuchFieldError(); - } - } - - public enum Event {; - private final long id; - Event(long id) { - this.id = id; - } - - public long getID() { - return id; - } - - public static Event value(long id) throws NoSuchFieldError { - for (Event event : Event.values()) { - if (event.getID() == id) { - return event; - } - } - throw new NoSuchFieldError(); - } - } - - public enum Command {; - private final long id; - Command(long id) { - this.id = id; - } - - public long getID() { - return id; - } - - public static Command value(long id) throws NoSuchFieldError { - for (Command command : Command.values()) { - if (command.getID() == id) { - return command; - } - } - throw new NoSuchFieldError(); - } - }@Override - public String getAttributeName(long id) throws NoSuchFieldError { - return Attribute.value(id).toString(); - } - - @Override - public String getEventName(long id) throws NoSuchFieldError { - return Event.value(id).toString(); - } - - @Override - public String getCommandName(long id) throws NoSuchFieldError { - return Command.value(id).toString(); - } - - @Override - public long getAttributeID(String name) throws IllegalArgumentException { - return Attribute.valueOf(name).getID(); - } - - @Override - public long getEventID(String name) throws IllegalArgumentException { - return Event.valueOf(name).getID(); - } - - @Override - public long getCommandID(String name) throws IllegalArgumentException { - return Command.valueOf(name).getID(); - } - } public static class LevelControl implements BaseCluster { public static final long ID = 8L; public long getID() { @@ -1260,115 +1146,6 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class BinaryInputBasic implements BaseCluster { - public static final long ID = 15L; - public long getID() { - return ID; - } - - public enum Attribute { - ActiveText(4L), - Description(28L), - InactiveText(46L), - OutOfService(81L), - Polarity(84L), - PresentValue(85L), - Reliability(103L), - StatusFlags(111L), - ApplicationType(256L), - GeneratedCommandList(65528L), - AcceptedCommandList(65529L), - EventList(65530L), - AttributeList(65531L), - FeatureMap(65532L), - ClusterRevision(65533L),; - private final long id; - Attribute(long id) { - this.id = id; - } - - public long getID() { - return id; - } - - public static Attribute value(long id) throws NoSuchFieldError { - for (Attribute attribute : Attribute.values()) { - if (attribute.getID() == id) { - return attribute; - } - } - throw new NoSuchFieldError(); - } - } - - public enum Event {; - private final long id; - Event(long id) { - this.id = id; - } - - public long getID() { - return id; - } - - public static Event value(long id) throws NoSuchFieldError { - for (Event event : Event.values()) { - if (event.getID() == id) { - return event; - } - } - throw new NoSuchFieldError(); - } - } - - public enum Command {; - private final long id; - Command(long id) { - this.id = id; - } - - public long getID() { - return id; - } - - public static Command value(long id) throws NoSuchFieldError { - for (Command command : Command.values()) { - if (command.getID() == id) { - return command; - } - } - throw new NoSuchFieldError(); - } - }@Override - public String getAttributeName(long id) throws NoSuchFieldError { - return Attribute.value(id).toString(); - } - - @Override - public String getEventName(long id) throws NoSuchFieldError { - return Event.value(id).toString(); - } - - @Override - public String getCommandName(long id) throws NoSuchFieldError { - return Command.value(id).toString(); - } - - @Override - public long getAttributeID(String name) throws IllegalArgumentException { - return Attribute.valueOf(name).getID(); - } - - @Override - public long getEventID(String name) throws IllegalArgumentException { - return Event.valueOf(name).getID(); - } - - @Override - public long getCommandID(String name) throws IllegalArgumentException { - return Command.valueOf(name).getID(); - } - } public static class PulseWidthModulation implements BaseCluster { public static final long ID = 28L; public long getID() { @@ -11499,135 +11276,6 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class BarrierControl implements BaseCluster { - public static final long ID = 259L; - public long getID() { - return ID; - } - - public enum Attribute { - BarrierMovingState(1L), - BarrierSafetyStatus(2L), - BarrierCapabilities(3L), - BarrierOpenEvents(4L), - BarrierCloseEvents(5L), - BarrierCommandOpenEvents(6L), - BarrierCommandCloseEvents(7L), - BarrierOpenPeriod(8L), - BarrierClosePeriod(9L), - BarrierPosition(10L), - GeneratedCommandList(65528L), - AcceptedCommandList(65529L), - EventList(65530L), - AttributeList(65531L), - FeatureMap(65532L), - ClusterRevision(65533L),; - private final long id; - Attribute(long id) { - this.id = id; - } - - public long getID() { - return id; - } - - public static Attribute value(long id) throws NoSuchFieldError { - for (Attribute attribute : Attribute.values()) { - if (attribute.getID() == id) { - return attribute; - } - } - throw new NoSuchFieldError(); - } - } - - public enum Event {; - private final long id; - Event(long id) { - this.id = id; - } - - public long getID() { - return id; - } - - public static Event value(long id) throws NoSuchFieldError { - for (Event event : Event.values()) { - if (event.getID() == id) { - return event; - } - } - throw new NoSuchFieldError(); - } - } - - public enum Command { - BarrierControlGoToPercent(0L), - BarrierControlStop(1L),; - private final long id; - Command(long id) { - this.id = id; - } - - public long getID() { - return id; - } - - public static Command value(long id) throws NoSuchFieldError { - for (Command command : Command.values()) { - if (command.getID() == id) { - return command; - } - } - throw new NoSuchFieldError(); - } - }public enum BarrierControlGoToPercentCommandField {PercentOpen(0),; - private final int id; - BarrierControlGoToPercentCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static BarrierControlGoToPercentCommandField value(int id) throws NoSuchFieldError { - for (BarrierControlGoToPercentCommandField field : BarrierControlGoToPercentCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } - }@Override - public String getAttributeName(long id) throws NoSuchFieldError { - return Attribute.value(id).toString(); - } - - @Override - public String getEventName(long id) throws NoSuchFieldError { - return Event.value(id).toString(); - } - - @Override - public String getCommandName(long id) throws NoSuchFieldError { - return Command.value(id).toString(); - } - - @Override - public long getAttributeID(String name) throws IllegalArgumentException { - return Attribute.valueOf(name).getID(); - } - - @Override - public long getEventID(String name) throws IllegalArgumentException { - return Event.valueOf(name).getID(); - } - - @Override - public long getCommandID(String name) throws IllegalArgumentException { - return Command.valueOf(name).getID(); - } - } public static class ServiceArea implements BaseCluster { public static final long ID = 336L; public long getID() { @@ -17470,253 +17118,6 @@ public long getCommandID(String name) throws IllegalArgumentException { return Command.valueOf(name).getID(); } } - public static class ElectricalMeasurement implements BaseCluster { - public static final long ID = 2820L; - public long getID() { - return ID; - } - - public enum Attribute { - MeasurementType(0L), - DcVoltage(256L), - DcVoltageMin(257L), - DcVoltageMax(258L), - DcCurrent(259L), - DcCurrentMin(260L), - DcCurrentMax(261L), - DcPower(262L), - DcPowerMin(263L), - DcPowerMax(264L), - DcVoltageMultiplier(512L), - DcVoltageDivisor(513L), - DcCurrentMultiplier(514L), - DcCurrentDivisor(515L), - DcPowerMultiplier(516L), - DcPowerDivisor(517L), - AcFrequency(768L), - AcFrequencyMin(769L), - AcFrequencyMax(770L), - NeutralCurrent(771L), - TotalActivePower(772L), - TotalReactivePower(773L), - TotalApparentPower(774L), - Measured1stHarmonicCurrent(775L), - Measured3rdHarmonicCurrent(776L), - Measured5thHarmonicCurrent(777L), - Measured7thHarmonicCurrent(778L), - Measured9thHarmonicCurrent(779L), - Measured11thHarmonicCurrent(780L), - MeasuredPhase1stHarmonicCurrent(781L), - MeasuredPhase3rdHarmonicCurrent(782L), - MeasuredPhase5thHarmonicCurrent(783L), - MeasuredPhase7thHarmonicCurrent(784L), - MeasuredPhase9thHarmonicCurrent(785L), - MeasuredPhase11thHarmonicCurrent(786L), - AcFrequencyMultiplier(1024L), - AcFrequencyDivisor(1025L), - PowerMultiplier(1026L), - PowerDivisor(1027L), - HarmonicCurrentMultiplier(1028L), - PhaseHarmonicCurrentMultiplier(1029L), - InstantaneousVoltage(1280L), - InstantaneousLineCurrent(1281L), - InstantaneousActiveCurrent(1282L), - InstantaneousReactiveCurrent(1283L), - InstantaneousPower(1284L), - RmsVoltage(1285L), - RmsVoltageMin(1286L), - RmsVoltageMax(1287L), - RmsCurrent(1288L), - RmsCurrentMin(1289L), - RmsCurrentMax(1290L), - ActivePower(1291L), - ActivePowerMin(1292L), - ActivePowerMax(1293L), - ReactivePower(1294L), - ApparentPower(1295L), - PowerFactor(1296L), - AverageRmsVoltageMeasurementPeriod(1297L), - AverageRmsUnderVoltageCounter(1299L), - RmsExtremeOverVoltagePeriod(1300L), - RmsExtremeUnderVoltagePeriod(1301L), - RmsVoltageSagPeriod(1302L), - RmsVoltageSwellPeriod(1303L), - AcVoltageMultiplier(1536L), - AcVoltageDivisor(1537L), - AcCurrentMultiplier(1538L), - AcCurrentDivisor(1539L), - AcPowerMultiplier(1540L), - AcPowerDivisor(1541L), - OverloadAlarmsMask(1792L), - VoltageOverload(1793L), - CurrentOverload(1794L), - AcOverloadAlarmsMask(2048L), - AcVoltageOverload(2049L), - AcCurrentOverload(2050L), - AcActivePowerOverload(2051L), - AcReactivePowerOverload(2052L), - AverageRmsOverVoltage(2053L), - AverageRmsUnderVoltage(2054L), - RmsExtremeOverVoltage(2055L), - RmsExtremeUnderVoltage(2056L), - RmsVoltageSag(2057L), - RmsVoltageSwell(2058L), - LineCurrentPhaseB(2305L), - ActiveCurrentPhaseB(2306L), - ReactiveCurrentPhaseB(2307L), - RmsVoltagePhaseB(2309L), - RmsVoltageMinPhaseB(2310L), - RmsVoltageMaxPhaseB(2311L), - RmsCurrentPhaseB(2312L), - RmsCurrentMinPhaseB(2313L), - RmsCurrentMaxPhaseB(2314L), - ActivePowerPhaseB(2315L), - ActivePowerMinPhaseB(2316L), - ActivePowerMaxPhaseB(2317L), - ReactivePowerPhaseB(2318L), - ApparentPowerPhaseB(2319L), - PowerFactorPhaseB(2320L), - AverageRmsVoltageMeasurementPeriodPhaseB(2321L), - AverageRmsOverVoltageCounterPhaseB(2322L), - AverageRmsUnderVoltageCounterPhaseB(2323L), - RmsExtremeOverVoltagePeriodPhaseB(2324L), - RmsExtremeUnderVoltagePeriodPhaseB(2325L), - RmsVoltageSagPeriodPhaseB(2326L), - RmsVoltageSwellPeriodPhaseB(2327L), - LineCurrentPhaseC(2561L), - ActiveCurrentPhaseC(2562L), - ReactiveCurrentPhaseC(2563L), - RmsVoltagePhaseC(2565L), - RmsVoltageMinPhaseC(2566L), - RmsVoltageMaxPhaseC(2567L), - RmsCurrentPhaseC(2568L), - RmsCurrentMinPhaseC(2569L), - RmsCurrentMaxPhaseC(2570L), - ActivePowerPhaseC(2571L), - ActivePowerMinPhaseC(2572L), - ActivePowerMaxPhaseC(2573L), - ReactivePowerPhaseC(2574L), - ApparentPowerPhaseC(2575L), - PowerFactorPhaseC(2576L), - AverageRmsVoltageMeasurementPeriodPhaseC(2577L), - AverageRmsOverVoltageCounterPhaseC(2578L), - AverageRmsUnderVoltageCounterPhaseC(2579L), - RmsExtremeOverVoltagePeriodPhaseC(2580L), - RmsExtremeUnderVoltagePeriodPhaseC(2581L), - RmsVoltageSagPeriodPhaseC(2582L), - RmsVoltageSwellPeriodPhaseC(2583L), - GeneratedCommandList(65528L), - AcceptedCommandList(65529L), - EventList(65530L), - AttributeList(65531L), - FeatureMap(65532L), - ClusterRevision(65533L),; - private final long id; - Attribute(long id) { - this.id = id; - } - - public long getID() { - return id; - } - - public static Attribute value(long id) throws NoSuchFieldError { - for (Attribute attribute : Attribute.values()) { - if (attribute.getID() == id) { - return attribute; - } - } - throw new NoSuchFieldError(); - } - } - - public enum Event {; - private final long id; - Event(long id) { - this.id = id; - } - - public long getID() { - return id; - } - - public static Event value(long id) throws NoSuchFieldError { - for (Event event : Event.values()) { - if (event.getID() == id) { - return event; - } - } - throw new NoSuchFieldError(); - } - } - - public enum Command { - GetProfileInfoCommand(0L), - GetMeasurementProfileCommand(1L),; - private final long id; - Command(long id) { - this.id = id; - } - - public long getID() { - return id; - } - - public static Command value(long id) throws NoSuchFieldError { - for (Command command : Command.values()) { - if (command.getID() == id) { - return command; - } - } - throw new NoSuchFieldError(); - } - }public enum GetMeasurementProfileCommandCommandField {AttributeId(0),StartTime(1),NumberOfIntervals(2),; - private final int id; - GetMeasurementProfileCommandCommandField(int id) { - this.id = id; - } - - public int getID() { - return id; - } - public static GetMeasurementProfileCommandCommandField value(int id) throws NoSuchFieldError { - for (GetMeasurementProfileCommandCommandField field : GetMeasurementProfileCommandCommandField.values()) { - if (field.getID() == id) { - return field; - } - } - throw new NoSuchFieldError(); - } - }@Override - public String getAttributeName(long id) throws NoSuchFieldError { - return Attribute.value(id).toString(); - } - - @Override - public String getEventName(long id) throws NoSuchFieldError { - return Event.value(id).toString(); - } - - @Override - public String getCommandName(long id) throws NoSuchFieldError { - return Command.value(id).toString(); - } - - @Override - public long getAttributeID(String name) throws IllegalArgumentException { - return Attribute.valueOf(name).getID(); - } - - @Override - public long getEventID(String name) throws IllegalArgumentException { - return Event.valueOf(name).getID(); - } - - @Override - public long getCommandID(String name) throws IllegalArgumentException { - return Command.valueOf(name).getID(); - } - } public static class UnitTesting implements BaseCluster { public static final long ID = 4294048773L; public long getID() { diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java index 6e009e3ae63c5a..40427e62794337 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterInfoMapping.java @@ -585,90 +585,6 @@ public void onError(Exception ex) { } } - public static class DelegatedOnOffSwitchConfigurationClusterGeneratedCommandListAttributeCallback implements ChipClusters.OnOffSwitchConfigurationCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedOnOffSwitchConfigurationClusterAcceptedCommandListAttributeCallback implements ChipClusters.OnOffSwitchConfigurationCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedOnOffSwitchConfigurationClusterEventListAttributeCallback implements ChipClusters.OnOffSwitchConfigurationCluster.EventListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedOnOffSwitchConfigurationClusterAttributeListAttributeCallback implements ChipClusters.OnOffSwitchConfigurationCluster.AttributeListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - public static class DelegatedLevelControlClusterCurrentLevelAttributeCallback implements ChipClusters.LevelControlCluster.CurrentLevelAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -879,90 +795,6 @@ public void onError(Exception ex) { } } - public static class DelegatedBinaryInputBasicClusterGeneratedCommandListAttributeCallback implements ChipClusters.BinaryInputBasicCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedBinaryInputBasicClusterAcceptedCommandListAttributeCallback implements ChipClusters.BinaryInputBasicCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedBinaryInputBasicClusterEventListAttributeCallback implements ChipClusters.BinaryInputBasicCluster.EventListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedBinaryInputBasicClusterAttributeListAttributeCallback implements ChipClusters.BinaryInputBasicCluster.AttributeListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - public static class DelegatedPulseWidthModulationClusterGeneratedCommandListAttributeCallback implements ChipClusters.PulseWidthModulationCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @Override @@ -13054,90 +12886,6 @@ public void onError(Exception ex) { } } - public static class DelegatedBarrierControlClusterGeneratedCommandListAttributeCallback implements ChipClusters.BarrierControlCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedBarrierControlClusterAcceptedCommandListAttributeCallback implements ChipClusters.BarrierControlCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedBarrierControlClusterEventListAttributeCallback implements ChipClusters.BarrierControlCluster.EventListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedBarrierControlClusterAttributeListAttributeCallback implements ChipClusters.BarrierControlCluster.AttributeListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - public static class DelegatedServiceAreaClusterSelectAreasResponseCallback implements ChipClusters.ServiceAreaCluster.SelectAreasResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -20484,90 +20232,6 @@ public void onError(Exception ex) { } } - public static class DelegatedElectricalMeasurementClusterGeneratedCommandListAttributeCallback implements ChipClusters.ElectricalMeasurementCluster.GeneratedCommandListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedElectricalMeasurementClusterAcceptedCommandListAttributeCallback implements ChipClusters.ElectricalMeasurementCluster.AcceptedCommandListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedElectricalMeasurementClusterEventListAttributeCallback implements ChipClusters.ElectricalMeasurementCluster.EventListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - - public static class DelegatedElectricalMeasurementClusterAttributeListAttributeCallback implements ChipClusters.ElectricalMeasurementCluster.AttributeListAttributeCallback, DelegatedClusterCallback { - private ClusterCommandCallback callback; - @Override - public void setCallbackDelegate(ClusterCommandCallback callback) { - this.callback = callback; - } - - @Override - public void onSuccess(List valueList) { - Map responseValues = new LinkedHashMap<>(); - CommandResponseInfo commandResponseInfo = new CommandResponseInfo("valueList", "List"); - responseValues.put(commandResponseInfo, valueList); - callback.onSuccess(responseValues); - } - - @Override - public void onError(Exception ex) { - callback.onFailure(ex); - } - } - public static class DelegatedUnitTestingClusterTestSpecificResponseCallback implements ChipClusters.UnitTestingCluster.TestSpecificResponseCallback, DelegatedClusterCallback { private ClusterCommandCallback callback; @@ -22208,18 +21872,10 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.OnOffCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("onOff", onOffClusterInfo); - ClusterInfo onOffSwitchConfigurationClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.OnOffSwitchConfigurationCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("onOffSwitchConfiguration", onOffSwitchConfigurationClusterInfo); - ClusterInfo levelControlClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.LevelControlCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("levelControl", levelControlClusterInfo); - ClusterInfo binaryInputBasicClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.BinaryInputBasicCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("binaryInputBasic", binaryInputBasicClusterInfo); - ClusterInfo pulseWidthModulationClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.PulseWidthModulationCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("pulseWidthModulation", pulseWidthModulationClusterInfo); @@ -22512,10 +22168,6 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.WindowCoveringCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("windowCovering", windowCoveringClusterInfo); - ClusterInfo barrierControlClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.BarrierControlCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("barrierControl", barrierControlClusterInfo); - ClusterInfo serviceAreaClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.ServiceAreaCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("serviceArea", serviceAreaClusterInfo); @@ -22684,10 +22336,6 @@ public Map initializeClusterMap() { (ptr, endpointId) -> new ChipClusters.CommissionerControlCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("commissionerControl", commissionerControlClusterInfo); - ClusterInfo electricalMeasurementClusterInfo = new ClusterInfo( - (ptr, endpointId) -> new ChipClusters.ElectricalMeasurementCluster(ptr, endpointId), new HashMap<>()); - clusterMap.put("electricalMeasurement", electricalMeasurementClusterInfo); - ClusterInfo unitTestingClusterInfo = new ClusterInfo( (ptr, endpointId) -> new ChipClusters.UnitTestingCluster(ptr, endpointId), new HashMap<>()); clusterMap.put("unitTesting", unitTestingClusterInfo); @@ -22707,9 +22355,7 @@ public void combineCommand(Map destination, Map destination, Map destination, Map> getCommandMap() { commandMap.put("onOff", onOffClusterInteractionInfoMap); - Map onOffSwitchConfigurationClusterInteractionInfoMap = new LinkedHashMap<>(); - - commandMap.put("onOffSwitchConfiguration", onOffSwitchConfigurationClusterInteractionInfoMap); - Map levelControlClusterInteractionInfoMap = new LinkedHashMap<>(); Map levelControlmoveToLevelCommandParams = new LinkedHashMap(); @@ -23367,10 +23007,6 @@ public Map> getCommandMap() { commandMap.put("levelControl", levelControlClusterInteractionInfoMap); - Map binaryInputBasicClusterInteractionInfoMap = new LinkedHashMap<>(); - - commandMap.put("binaryInputBasic", binaryInputBasicClusterInteractionInfoMap); - Map pulseWidthModulationClusterInteractionInfoMap = new LinkedHashMap<>(); commandMap.put("pulseWidthModulation", pulseWidthModulationClusterInteractionInfoMap); @@ -26911,39 +26547,6 @@ public Map> getCommandMap() { commandMap.put("windowCovering", windowCoveringClusterInteractionInfoMap); - Map barrierControlClusterInteractionInfoMap = new LinkedHashMap<>(); - - Map barrierControlbarrierControlGoToPercentCommandParams = new LinkedHashMap(); - - CommandParameterInfo barrierControlbarrierControlGoToPercentpercentOpenCommandParameterInfo = new CommandParameterInfo("percentOpen", Integer.class, Integer.class); - barrierControlbarrierControlGoToPercentCommandParams.put("percentOpen",barrierControlbarrierControlGoToPercentpercentOpenCommandParameterInfo); - InteractionInfo barrierControlbarrierControlGoToPercentInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster) - .barrierControlGoToPercent((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("percentOpen") - ); - }, - () -> new DelegatedDefaultClusterCallback(), - barrierControlbarrierControlGoToPercentCommandParams - ); - barrierControlClusterInteractionInfoMap.put("barrierControlGoToPercent", barrierControlbarrierControlGoToPercentInteractionInfo); - - Map barrierControlbarrierControlStopCommandParams = new LinkedHashMap(); - InteractionInfo barrierControlbarrierControlStopInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster) - .barrierControlStop((DefaultClusterCallback) callback - ); - }, - () -> new DelegatedDefaultClusterCallback(), - barrierControlbarrierControlStopCommandParams - ); - barrierControlClusterInteractionInfoMap.put("barrierControlStop", barrierControlbarrierControlStopInteractionInfo); - - commandMap.put("barrierControl", barrierControlClusterInteractionInfoMap); - Map serviceAreaClusterInteractionInfoMap = new LinkedHashMap<>(); Map serviceAreaselectAreasCommandParams = new LinkedHashMap(); @@ -29088,49 +28691,6 @@ public Map> getCommandMap() { commandMap.put("commissionerControl", commissionerControlClusterInteractionInfoMap); - Map electricalMeasurementClusterInteractionInfoMap = new LinkedHashMap<>(); - - Map electricalMeasurementgetProfileInfoCommandCommandParams = new LinkedHashMap(); - InteractionInfo electricalMeasurementgetProfileInfoCommandInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster) - .getProfileInfoCommand((DefaultClusterCallback) callback - ); - }, - () -> new DelegatedDefaultClusterCallback(), - electricalMeasurementgetProfileInfoCommandCommandParams - ); - electricalMeasurementClusterInteractionInfoMap.put("getProfileInfoCommand", electricalMeasurementgetProfileInfoCommandInteractionInfo); - - Map electricalMeasurementgetMeasurementProfileCommandCommandParams = new LinkedHashMap(); - - CommandParameterInfo electricalMeasurementgetMeasurementProfileCommandattributeIdCommandParameterInfo = new CommandParameterInfo("attributeId", Integer.class, Integer.class); - electricalMeasurementgetMeasurementProfileCommandCommandParams.put("attributeId",electricalMeasurementgetMeasurementProfileCommandattributeIdCommandParameterInfo); - - CommandParameterInfo electricalMeasurementgetMeasurementProfileCommandstartTimeCommandParameterInfo = new CommandParameterInfo("startTime", Long.class, Long.class); - electricalMeasurementgetMeasurementProfileCommandCommandParams.put("startTime",electricalMeasurementgetMeasurementProfileCommandstartTimeCommandParameterInfo); - - CommandParameterInfo electricalMeasurementgetMeasurementProfileCommandnumberOfIntervalsCommandParameterInfo = new CommandParameterInfo("numberOfIntervals", Integer.class, Integer.class); - electricalMeasurementgetMeasurementProfileCommandCommandParams.put("numberOfIntervals",electricalMeasurementgetMeasurementProfileCommandnumberOfIntervalsCommandParameterInfo); - InteractionInfo electricalMeasurementgetMeasurementProfileCommandInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster) - .getMeasurementProfileCommand((DefaultClusterCallback) callback - , (Integer) - commandArguments.get("attributeId") - , (Long) - commandArguments.get("startTime") - , (Integer) - commandArguments.get("numberOfIntervals") - ); - }, - () -> new DelegatedDefaultClusterCallback(), - electricalMeasurementgetMeasurementProfileCommandCommandParams - ); - electricalMeasurementClusterInteractionInfoMap.put("getMeasurementProfileCommand", electricalMeasurementgetMeasurementProfileCommandInteractionInfo); - - commandMap.put("electricalMeasurement", electricalMeasurementClusterInteractionInfoMap); - Map unitTestingClusterInteractionInfoMap = new LinkedHashMap<>(); Map unitTestingtestCommandParams = new LinkedHashMap(); diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java index b09c89302d33b6..7de9e8cdc25d2f 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterReadMapping.java @@ -323,98 +323,6 @@ private static Map readOnOffInteractionInfo() { return result; } - private static Map readOnOffSwitchConfigurationInteractionInfo() { - Map result = new LinkedHashMap<>();Map readOnOffSwitchConfigurationSwitchTypeCommandParams = new LinkedHashMap(); - InteractionInfo readOnOffSwitchConfigurationSwitchTypeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffSwitchConfigurationCluster) cluster).readSwitchTypeAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readOnOffSwitchConfigurationSwitchTypeCommandParams - ); - result.put("readSwitchTypeAttribute", readOnOffSwitchConfigurationSwitchTypeAttributeInteractionInfo); - Map readOnOffSwitchConfigurationSwitchActionsCommandParams = new LinkedHashMap(); - InteractionInfo readOnOffSwitchConfigurationSwitchActionsAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffSwitchConfigurationCluster) cluster).readSwitchActionsAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readOnOffSwitchConfigurationSwitchActionsCommandParams - ); - result.put("readSwitchActionsAttribute", readOnOffSwitchConfigurationSwitchActionsAttributeInteractionInfo); - Map readOnOffSwitchConfigurationGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readOnOffSwitchConfigurationGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffSwitchConfigurationCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.OnOffSwitchConfigurationCluster.GeneratedCommandListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedOnOffSwitchConfigurationClusterGeneratedCommandListAttributeCallback(), - readOnOffSwitchConfigurationGeneratedCommandListCommandParams - ); - result.put("readGeneratedCommandListAttribute", readOnOffSwitchConfigurationGeneratedCommandListAttributeInteractionInfo); - Map readOnOffSwitchConfigurationAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readOnOffSwitchConfigurationAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffSwitchConfigurationCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.OnOffSwitchConfigurationCluster.AcceptedCommandListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedOnOffSwitchConfigurationClusterAcceptedCommandListAttributeCallback(), - readOnOffSwitchConfigurationAcceptedCommandListCommandParams - ); - result.put("readAcceptedCommandListAttribute", readOnOffSwitchConfigurationAcceptedCommandListAttributeInteractionInfo); - Map readOnOffSwitchConfigurationEventListCommandParams = new LinkedHashMap(); - InteractionInfo readOnOffSwitchConfigurationEventListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffSwitchConfigurationCluster) cluster).readEventListAttribute( - (ChipClusters.OnOffSwitchConfigurationCluster.EventListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedOnOffSwitchConfigurationClusterEventListAttributeCallback(), - readOnOffSwitchConfigurationEventListCommandParams - ); - result.put("readEventListAttribute", readOnOffSwitchConfigurationEventListAttributeInteractionInfo); - Map readOnOffSwitchConfigurationAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readOnOffSwitchConfigurationAttributeListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffSwitchConfigurationCluster) cluster).readAttributeListAttribute( - (ChipClusters.OnOffSwitchConfigurationCluster.AttributeListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedOnOffSwitchConfigurationClusterAttributeListAttributeCallback(), - readOnOffSwitchConfigurationAttributeListCommandParams - ); - result.put("readAttributeListAttribute", readOnOffSwitchConfigurationAttributeListAttributeInteractionInfo); - Map readOnOffSwitchConfigurationFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readOnOffSwitchConfigurationFeatureMapAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffSwitchConfigurationCluster) cluster).readFeatureMapAttribute( - (ChipClusters.LongAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readOnOffSwitchConfigurationFeatureMapCommandParams - ); - result.put("readFeatureMapAttribute", readOnOffSwitchConfigurationFeatureMapAttributeInteractionInfo); - Map readOnOffSwitchConfigurationClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readOnOffSwitchConfigurationClusterRevisionAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffSwitchConfigurationCluster) cluster).readClusterRevisionAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readOnOffSwitchConfigurationClusterRevisionCommandParams - ); - result.put("readClusterRevisionAttribute", readOnOffSwitchConfigurationClusterRevisionAttributeInteractionInfo); - - return result; - } private static Map readLevelControlInteractionInfo() { Map result = new LinkedHashMap<>();Map readLevelControlCurrentLevelCommandParams = new LinkedHashMap(); InteractionInfo readLevelControlCurrentLevelAttributeInteractionInfo = new InteractionInfo( @@ -639,175 +547,6 @@ private static Map readLevelControlInteractionInfo() { return result; } - private static Map readBinaryInputBasicInteractionInfo() { - Map result = new LinkedHashMap<>();Map readBinaryInputBasicActiveTextCommandParams = new LinkedHashMap(); - InteractionInfo readBinaryInputBasicActiveTextAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).readActiveTextAttribute( - (ChipClusters.CharStringAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readBinaryInputBasicActiveTextCommandParams - ); - result.put("readActiveTextAttribute", readBinaryInputBasicActiveTextAttributeInteractionInfo); - Map readBinaryInputBasicDescriptionCommandParams = new LinkedHashMap(); - InteractionInfo readBinaryInputBasicDescriptionAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).readDescriptionAttribute( - (ChipClusters.CharStringAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readBinaryInputBasicDescriptionCommandParams - ); - result.put("readDescriptionAttribute", readBinaryInputBasicDescriptionAttributeInteractionInfo); - Map readBinaryInputBasicInactiveTextCommandParams = new LinkedHashMap(); - InteractionInfo readBinaryInputBasicInactiveTextAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).readInactiveTextAttribute( - (ChipClusters.CharStringAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedCharStringAttributeCallback(), - readBinaryInputBasicInactiveTextCommandParams - ); - result.put("readInactiveTextAttribute", readBinaryInputBasicInactiveTextAttributeInteractionInfo); - Map readBinaryInputBasicOutOfServiceCommandParams = new LinkedHashMap(); - InteractionInfo readBinaryInputBasicOutOfServiceAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).readOutOfServiceAttribute( - (ChipClusters.BooleanAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), - readBinaryInputBasicOutOfServiceCommandParams - ); - result.put("readOutOfServiceAttribute", readBinaryInputBasicOutOfServiceAttributeInteractionInfo); - Map readBinaryInputBasicPolarityCommandParams = new LinkedHashMap(); - InteractionInfo readBinaryInputBasicPolarityAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).readPolarityAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBinaryInputBasicPolarityCommandParams - ); - result.put("readPolarityAttribute", readBinaryInputBasicPolarityAttributeInteractionInfo); - Map readBinaryInputBasicPresentValueCommandParams = new LinkedHashMap(); - InteractionInfo readBinaryInputBasicPresentValueAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).readPresentValueAttribute( - (ChipClusters.BooleanAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedBooleanAttributeCallback(), - readBinaryInputBasicPresentValueCommandParams - ); - result.put("readPresentValueAttribute", readBinaryInputBasicPresentValueAttributeInteractionInfo); - Map readBinaryInputBasicReliabilityCommandParams = new LinkedHashMap(); - InteractionInfo readBinaryInputBasicReliabilityAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).readReliabilityAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBinaryInputBasicReliabilityCommandParams - ); - result.put("readReliabilityAttribute", readBinaryInputBasicReliabilityAttributeInteractionInfo); - Map readBinaryInputBasicStatusFlagsCommandParams = new LinkedHashMap(); - InteractionInfo readBinaryInputBasicStatusFlagsAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).readStatusFlagsAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBinaryInputBasicStatusFlagsCommandParams - ); - result.put("readStatusFlagsAttribute", readBinaryInputBasicStatusFlagsAttributeInteractionInfo); - Map readBinaryInputBasicApplicationTypeCommandParams = new LinkedHashMap(); - InteractionInfo readBinaryInputBasicApplicationTypeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).readApplicationTypeAttribute( - (ChipClusters.LongAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readBinaryInputBasicApplicationTypeCommandParams - ); - result.put("readApplicationTypeAttribute", readBinaryInputBasicApplicationTypeAttributeInteractionInfo); - Map readBinaryInputBasicGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readBinaryInputBasicGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.BinaryInputBasicCluster.GeneratedCommandListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedBinaryInputBasicClusterGeneratedCommandListAttributeCallback(), - readBinaryInputBasicGeneratedCommandListCommandParams - ); - result.put("readGeneratedCommandListAttribute", readBinaryInputBasicGeneratedCommandListAttributeInteractionInfo); - Map readBinaryInputBasicAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readBinaryInputBasicAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.BinaryInputBasicCluster.AcceptedCommandListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedBinaryInputBasicClusterAcceptedCommandListAttributeCallback(), - readBinaryInputBasicAcceptedCommandListCommandParams - ); - result.put("readAcceptedCommandListAttribute", readBinaryInputBasicAcceptedCommandListAttributeInteractionInfo); - Map readBinaryInputBasicEventListCommandParams = new LinkedHashMap(); - InteractionInfo readBinaryInputBasicEventListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).readEventListAttribute( - (ChipClusters.BinaryInputBasicCluster.EventListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedBinaryInputBasicClusterEventListAttributeCallback(), - readBinaryInputBasicEventListCommandParams - ); - result.put("readEventListAttribute", readBinaryInputBasicEventListAttributeInteractionInfo); - Map readBinaryInputBasicAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readBinaryInputBasicAttributeListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).readAttributeListAttribute( - (ChipClusters.BinaryInputBasicCluster.AttributeListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedBinaryInputBasicClusterAttributeListAttributeCallback(), - readBinaryInputBasicAttributeListCommandParams - ); - result.put("readAttributeListAttribute", readBinaryInputBasicAttributeListAttributeInteractionInfo); - Map readBinaryInputBasicFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readBinaryInputBasicFeatureMapAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).readFeatureMapAttribute( - (ChipClusters.LongAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readBinaryInputBasicFeatureMapCommandParams - ); - result.put("readFeatureMapAttribute", readBinaryInputBasicFeatureMapAttributeInteractionInfo); - Map readBinaryInputBasicClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readBinaryInputBasicClusterRevisionAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).readClusterRevisionAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBinaryInputBasicClusterRevisionCommandParams - ); - result.put("readClusterRevisionAttribute", readBinaryInputBasicClusterRevisionAttributeInteractionInfo); - - return result; - } private static Map readPulseWidthModulationInteractionInfo() { Map result = new LinkedHashMap<>();Map readPulseWidthModulationGeneratedCommandListCommandParams = new LinkedHashMap(); InteractionInfo readPulseWidthModulationGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( @@ -11682,186 +11421,6 @@ private static Map readWindowCoveringInteractionInfo() return result; } - private static Map readBarrierControlInteractionInfo() { - Map result = new LinkedHashMap<>();Map readBarrierControlBarrierMovingStateCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlBarrierMovingStateAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readBarrierMovingStateAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBarrierControlBarrierMovingStateCommandParams - ); - result.put("readBarrierMovingStateAttribute", readBarrierControlBarrierMovingStateAttributeInteractionInfo); - Map readBarrierControlBarrierSafetyStatusCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlBarrierSafetyStatusAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readBarrierSafetyStatusAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBarrierControlBarrierSafetyStatusCommandParams - ); - result.put("readBarrierSafetyStatusAttribute", readBarrierControlBarrierSafetyStatusAttributeInteractionInfo); - Map readBarrierControlBarrierCapabilitiesCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlBarrierCapabilitiesAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readBarrierCapabilitiesAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBarrierControlBarrierCapabilitiesCommandParams - ); - result.put("readBarrierCapabilitiesAttribute", readBarrierControlBarrierCapabilitiesAttributeInteractionInfo); - Map readBarrierControlBarrierOpenEventsCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlBarrierOpenEventsAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readBarrierOpenEventsAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBarrierControlBarrierOpenEventsCommandParams - ); - result.put("readBarrierOpenEventsAttribute", readBarrierControlBarrierOpenEventsAttributeInteractionInfo); - Map readBarrierControlBarrierCloseEventsCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlBarrierCloseEventsAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readBarrierCloseEventsAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBarrierControlBarrierCloseEventsCommandParams - ); - result.put("readBarrierCloseEventsAttribute", readBarrierControlBarrierCloseEventsAttributeInteractionInfo); - Map readBarrierControlBarrierCommandOpenEventsCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlBarrierCommandOpenEventsAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readBarrierCommandOpenEventsAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBarrierControlBarrierCommandOpenEventsCommandParams - ); - result.put("readBarrierCommandOpenEventsAttribute", readBarrierControlBarrierCommandOpenEventsAttributeInteractionInfo); - Map readBarrierControlBarrierCommandCloseEventsCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlBarrierCommandCloseEventsAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readBarrierCommandCloseEventsAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBarrierControlBarrierCommandCloseEventsCommandParams - ); - result.put("readBarrierCommandCloseEventsAttribute", readBarrierControlBarrierCommandCloseEventsAttributeInteractionInfo); - Map readBarrierControlBarrierOpenPeriodCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlBarrierOpenPeriodAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readBarrierOpenPeriodAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBarrierControlBarrierOpenPeriodCommandParams - ); - result.put("readBarrierOpenPeriodAttribute", readBarrierControlBarrierOpenPeriodAttributeInteractionInfo); - Map readBarrierControlBarrierClosePeriodCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlBarrierClosePeriodAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readBarrierClosePeriodAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBarrierControlBarrierClosePeriodCommandParams - ); - result.put("readBarrierClosePeriodAttribute", readBarrierControlBarrierClosePeriodAttributeInteractionInfo); - Map readBarrierControlBarrierPositionCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlBarrierPositionAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readBarrierPositionAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBarrierControlBarrierPositionCommandParams - ); - result.put("readBarrierPositionAttribute", readBarrierControlBarrierPositionAttributeInteractionInfo); - Map readBarrierControlGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.BarrierControlCluster.GeneratedCommandListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedBarrierControlClusterGeneratedCommandListAttributeCallback(), - readBarrierControlGeneratedCommandListCommandParams - ); - result.put("readGeneratedCommandListAttribute", readBarrierControlGeneratedCommandListAttributeInteractionInfo); - Map readBarrierControlAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.BarrierControlCluster.AcceptedCommandListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedBarrierControlClusterAcceptedCommandListAttributeCallback(), - readBarrierControlAcceptedCommandListCommandParams - ); - result.put("readAcceptedCommandListAttribute", readBarrierControlAcceptedCommandListAttributeInteractionInfo); - Map readBarrierControlEventListCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlEventListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readEventListAttribute( - (ChipClusters.BarrierControlCluster.EventListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedBarrierControlClusterEventListAttributeCallback(), - readBarrierControlEventListCommandParams - ); - result.put("readEventListAttribute", readBarrierControlEventListAttributeInteractionInfo); - Map readBarrierControlAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlAttributeListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readAttributeListAttribute( - (ChipClusters.BarrierControlCluster.AttributeListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedBarrierControlClusterAttributeListAttributeCallback(), - readBarrierControlAttributeListCommandParams - ); - result.put("readAttributeListAttribute", readBarrierControlAttributeListAttributeInteractionInfo); - Map readBarrierControlFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlFeatureMapAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readFeatureMapAttribute( - (ChipClusters.LongAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readBarrierControlFeatureMapCommandParams - ); - result.put("readFeatureMapAttribute", readBarrierControlFeatureMapAttributeInteractionInfo); - Map readBarrierControlClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readBarrierControlClusterRevisionAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).readClusterRevisionAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readBarrierControlClusterRevisionCommandParams - ); - result.put("readClusterRevisionAttribute", readBarrierControlClusterRevisionAttributeInteractionInfo); - - return result; - } private static Map readServiceAreaInteractionInfo() { Map result = new LinkedHashMap<>();Map readServiceAreaSupportedAreasCommandParams = new LinkedHashMap(); InteractionInfo readServiceAreaSupportedAreasAttributeInteractionInfo = new InteractionInfo( @@ -18850,1484 +18409,6 @@ private static Map readCommissionerControlInteractionIn return result; } - private static Map readElectricalMeasurementInteractionInfo() { - Map result = new LinkedHashMap<>();Map readElectricalMeasurementMeasurementTypeCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementMeasurementTypeAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readMeasurementTypeAttribute( - (ChipClusters.LongAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readElectricalMeasurementMeasurementTypeCommandParams - ); - result.put("readMeasurementTypeAttribute", readElectricalMeasurementMeasurementTypeAttributeInteractionInfo); - Map readElectricalMeasurementDcVoltageCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementDcVoltageAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readDcVoltageAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementDcVoltageCommandParams - ); - result.put("readDcVoltageAttribute", readElectricalMeasurementDcVoltageAttributeInteractionInfo); - Map readElectricalMeasurementDcVoltageMinCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementDcVoltageMinAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readDcVoltageMinAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementDcVoltageMinCommandParams - ); - result.put("readDcVoltageMinAttribute", readElectricalMeasurementDcVoltageMinAttributeInteractionInfo); - Map readElectricalMeasurementDcVoltageMaxCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementDcVoltageMaxAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readDcVoltageMaxAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementDcVoltageMaxCommandParams - ); - result.put("readDcVoltageMaxAttribute", readElectricalMeasurementDcVoltageMaxAttributeInteractionInfo); - Map readElectricalMeasurementDcCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementDcCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readDcCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementDcCurrentCommandParams - ); - result.put("readDcCurrentAttribute", readElectricalMeasurementDcCurrentAttributeInteractionInfo); - Map readElectricalMeasurementDcCurrentMinCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementDcCurrentMinAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readDcCurrentMinAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementDcCurrentMinCommandParams - ); - result.put("readDcCurrentMinAttribute", readElectricalMeasurementDcCurrentMinAttributeInteractionInfo); - Map readElectricalMeasurementDcCurrentMaxCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementDcCurrentMaxAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readDcCurrentMaxAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementDcCurrentMaxCommandParams - ); - result.put("readDcCurrentMaxAttribute", readElectricalMeasurementDcCurrentMaxAttributeInteractionInfo); - Map readElectricalMeasurementDcPowerCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementDcPowerAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readDcPowerAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementDcPowerCommandParams - ); - result.put("readDcPowerAttribute", readElectricalMeasurementDcPowerAttributeInteractionInfo); - Map readElectricalMeasurementDcPowerMinCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementDcPowerMinAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readDcPowerMinAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementDcPowerMinCommandParams - ); - result.put("readDcPowerMinAttribute", readElectricalMeasurementDcPowerMinAttributeInteractionInfo); - Map readElectricalMeasurementDcPowerMaxCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementDcPowerMaxAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readDcPowerMaxAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementDcPowerMaxCommandParams - ); - result.put("readDcPowerMaxAttribute", readElectricalMeasurementDcPowerMaxAttributeInteractionInfo); - Map readElectricalMeasurementDcVoltageMultiplierCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementDcVoltageMultiplierAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readDcVoltageMultiplierAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementDcVoltageMultiplierCommandParams - ); - result.put("readDcVoltageMultiplierAttribute", readElectricalMeasurementDcVoltageMultiplierAttributeInteractionInfo); - Map readElectricalMeasurementDcVoltageDivisorCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementDcVoltageDivisorAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readDcVoltageDivisorAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementDcVoltageDivisorCommandParams - ); - result.put("readDcVoltageDivisorAttribute", readElectricalMeasurementDcVoltageDivisorAttributeInteractionInfo); - Map readElectricalMeasurementDcCurrentMultiplierCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementDcCurrentMultiplierAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readDcCurrentMultiplierAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementDcCurrentMultiplierCommandParams - ); - result.put("readDcCurrentMultiplierAttribute", readElectricalMeasurementDcCurrentMultiplierAttributeInteractionInfo); - Map readElectricalMeasurementDcCurrentDivisorCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementDcCurrentDivisorAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readDcCurrentDivisorAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementDcCurrentDivisorCommandParams - ); - result.put("readDcCurrentDivisorAttribute", readElectricalMeasurementDcCurrentDivisorAttributeInteractionInfo); - Map readElectricalMeasurementDcPowerMultiplierCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementDcPowerMultiplierAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readDcPowerMultiplierAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementDcPowerMultiplierCommandParams - ); - result.put("readDcPowerMultiplierAttribute", readElectricalMeasurementDcPowerMultiplierAttributeInteractionInfo); - Map readElectricalMeasurementDcPowerDivisorCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementDcPowerDivisorAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readDcPowerDivisorAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementDcPowerDivisorCommandParams - ); - result.put("readDcPowerDivisorAttribute", readElectricalMeasurementDcPowerDivisorAttributeInteractionInfo); - Map readElectricalMeasurementAcFrequencyCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcFrequencyAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcFrequencyAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcFrequencyCommandParams - ); - result.put("readAcFrequencyAttribute", readElectricalMeasurementAcFrequencyAttributeInteractionInfo); - Map readElectricalMeasurementAcFrequencyMinCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcFrequencyMinAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcFrequencyMinAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcFrequencyMinCommandParams - ); - result.put("readAcFrequencyMinAttribute", readElectricalMeasurementAcFrequencyMinAttributeInteractionInfo); - Map readElectricalMeasurementAcFrequencyMaxCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcFrequencyMaxAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcFrequencyMaxAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcFrequencyMaxCommandParams - ); - result.put("readAcFrequencyMaxAttribute", readElectricalMeasurementAcFrequencyMaxAttributeInteractionInfo); - Map readElectricalMeasurementNeutralCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementNeutralCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readNeutralCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementNeutralCurrentCommandParams - ); - result.put("readNeutralCurrentAttribute", readElectricalMeasurementNeutralCurrentAttributeInteractionInfo); - Map readElectricalMeasurementTotalActivePowerCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementTotalActivePowerAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readTotalActivePowerAttribute( - (ChipClusters.LongAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readElectricalMeasurementTotalActivePowerCommandParams - ); - result.put("readTotalActivePowerAttribute", readElectricalMeasurementTotalActivePowerAttributeInteractionInfo); - Map readElectricalMeasurementTotalReactivePowerCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementTotalReactivePowerAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readTotalReactivePowerAttribute( - (ChipClusters.LongAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readElectricalMeasurementTotalReactivePowerCommandParams - ); - result.put("readTotalReactivePowerAttribute", readElectricalMeasurementTotalReactivePowerAttributeInteractionInfo); - Map readElectricalMeasurementTotalApparentPowerCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementTotalApparentPowerAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readTotalApparentPowerAttribute( - (ChipClusters.LongAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readElectricalMeasurementTotalApparentPowerCommandParams - ); - result.put("readTotalApparentPowerAttribute", readElectricalMeasurementTotalApparentPowerAttributeInteractionInfo); - Map readElectricalMeasurementMeasured1stHarmonicCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementMeasured1stHarmonicCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readMeasured1stHarmonicCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementMeasured1stHarmonicCurrentCommandParams - ); - result.put("readMeasured1stHarmonicCurrentAttribute", readElectricalMeasurementMeasured1stHarmonicCurrentAttributeInteractionInfo); - Map readElectricalMeasurementMeasured3rdHarmonicCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementMeasured3rdHarmonicCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readMeasured3rdHarmonicCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementMeasured3rdHarmonicCurrentCommandParams - ); - result.put("readMeasured3rdHarmonicCurrentAttribute", readElectricalMeasurementMeasured3rdHarmonicCurrentAttributeInteractionInfo); - Map readElectricalMeasurementMeasured5thHarmonicCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementMeasured5thHarmonicCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readMeasured5thHarmonicCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementMeasured5thHarmonicCurrentCommandParams - ); - result.put("readMeasured5thHarmonicCurrentAttribute", readElectricalMeasurementMeasured5thHarmonicCurrentAttributeInteractionInfo); - Map readElectricalMeasurementMeasured7thHarmonicCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementMeasured7thHarmonicCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readMeasured7thHarmonicCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementMeasured7thHarmonicCurrentCommandParams - ); - result.put("readMeasured7thHarmonicCurrentAttribute", readElectricalMeasurementMeasured7thHarmonicCurrentAttributeInteractionInfo); - Map readElectricalMeasurementMeasured9thHarmonicCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementMeasured9thHarmonicCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readMeasured9thHarmonicCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementMeasured9thHarmonicCurrentCommandParams - ); - result.put("readMeasured9thHarmonicCurrentAttribute", readElectricalMeasurementMeasured9thHarmonicCurrentAttributeInteractionInfo); - Map readElectricalMeasurementMeasured11thHarmonicCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementMeasured11thHarmonicCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readMeasured11thHarmonicCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementMeasured11thHarmonicCurrentCommandParams - ); - result.put("readMeasured11thHarmonicCurrentAttribute", readElectricalMeasurementMeasured11thHarmonicCurrentAttributeInteractionInfo); - Map readElectricalMeasurementMeasuredPhase1stHarmonicCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementMeasuredPhase1stHarmonicCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readMeasuredPhase1stHarmonicCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementMeasuredPhase1stHarmonicCurrentCommandParams - ); - result.put("readMeasuredPhase1stHarmonicCurrentAttribute", readElectricalMeasurementMeasuredPhase1stHarmonicCurrentAttributeInteractionInfo); - Map readElectricalMeasurementMeasuredPhase3rdHarmonicCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementMeasuredPhase3rdHarmonicCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readMeasuredPhase3rdHarmonicCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementMeasuredPhase3rdHarmonicCurrentCommandParams - ); - result.put("readMeasuredPhase3rdHarmonicCurrentAttribute", readElectricalMeasurementMeasuredPhase3rdHarmonicCurrentAttributeInteractionInfo); - Map readElectricalMeasurementMeasuredPhase5thHarmonicCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementMeasuredPhase5thHarmonicCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readMeasuredPhase5thHarmonicCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementMeasuredPhase5thHarmonicCurrentCommandParams - ); - result.put("readMeasuredPhase5thHarmonicCurrentAttribute", readElectricalMeasurementMeasuredPhase5thHarmonicCurrentAttributeInteractionInfo); - Map readElectricalMeasurementMeasuredPhase7thHarmonicCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementMeasuredPhase7thHarmonicCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readMeasuredPhase7thHarmonicCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementMeasuredPhase7thHarmonicCurrentCommandParams - ); - result.put("readMeasuredPhase7thHarmonicCurrentAttribute", readElectricalMeasurementMeasuredPhase7thHarmonicCurrentAttributeInteractionInfo); - Map readElectricalMeasurementMeasuredPhase9thHarmonicCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementMeasuredPhase9thHarmonicCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readMeasuredPhase9thHarmonicCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementMeasuredPhase9thHarmonicCurrentCommandParams - ); - result.put("readMeasuredPhase9thHarmonicCurrentAttribute", readElectricalMeasurementMeasuredPhase9thHarmonicCurrentAttributeInteractionInfo); - Map readElectricalMeasurementMeasuredPhase11thHarmonicCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementMeasuredPhase11thHarmonicCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readMeasuredPhase11thHarmonicCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementMeasuredPhase11thHarmonicCurrentCommandParams - ); - result.put("readMeasuredPhase11thHarmonicCurrentAttribute", readElectricalMeasurementMeasuredPhase11thHarmonicCurrentAttributeInteractionInfo); - Map readElectricalMeasurementAcFrequencyMultiplierCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcFrequencyMultiplierAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcFrequencyMultiplierAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcFrequencyMultiplierCommandParams - ); - result.put("readAcFrequencyMultiplierAttribute", readElectricalMeasurementAcFrequencyMultiplierAttributeInteractionInfo); - Map readElectricalMeasurementAcFrequencyDivisorCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcFrequencyDivisorAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcFrequencyDivisorAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcFrequencyDivisorCommandParams - ); - result.put("readAcFrequencyDivisorAttribute", readElectricalMeasurementAcFrequencyDivisorAttributeInteractionInfo); - Map readElectricalMeasurementPowerMultiplierCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementPowerMultiplierAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readPowerMultiplierAttribute( - (ChipClusters.LongAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readElectricalMeasurementPowerMultiplierCommandParams - ); - result.put("readPowerMultiplierAttribute", readElectricalMeasurementPowerMultiplierAttributeInteractionInfo); - Map readElectricalMeasurementPowerDivisorCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementPowerDivisorAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readPowerDivisorAttribute( - (ChipClusters.LongAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readElectricalMeasurementPowerDivisorCommandParams - ); - result.put("readPowerDivisorAttribute", readElectricalMeasurementPowerDivisorAttributeInteractionInfo); - Map readElectricalMeasurementHarmonicCurrentMultiplierCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementHarmonicCurrentMultiplierAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readHarmonicCurrentMultiplierAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementHarmonicCurrentMultiplierCommandParams - ); - result.put("readHarmonicCurrentMultiplierAttribute", readElectricalMeasurementHarmonicCurrentMultiplierAttributeInteractionInfo); - Map readElectricalMeasurementPhaseHarmonicCurrentMultiplierCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementPhaseHarmonicCurrentMultiplierAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readPhaseHarmonicCurrentMultiplierAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementPhaseHarmonicCurrentMultiplierCommandParams - ); - result.put("readPhaseHarmonicCurrentMultiplierAttribute", readElectricalMeasurementPhaseHarmonicCurrentMultiplierAttributeInteractionInfo); - Map readElectricalMeasurementInstantaneousVoltageCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementInstantaneousVoltageAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readInstantaneousVoltageAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementInstantaneousVoltageCommandParams - ); - result.put("readInstantaneousVoltageAttribute", readElectricalMeasurementInstantaneousVoltageAttributeInteractionInfo); - Map readElectricalMeasurementInstantaneousLineCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementInstantaneousLineCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readInstantaneousLineCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementInstantaneousLineCurrentCommandParams - ); - result.put("readInstantaneousLineCurrentAttribute", readElectricalMeasurementInstantaneousLineCurrentAttributeInteractionInfo); - Map readElectricalMeasurementInstantaneousActiveCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementInstantaneousActiveCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readInstantaneousActiveCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementInstantaneousActiveCurrentCommandParams - ); - result.put("readInstantaneousActiveCurrentAttribute", readElectricalMeasurementInstantaneousActiveCurrentAttributeInteractionInfo); - Map readElectricalMeasurementInstantaneousReactiveCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementInstantaneousReactiveCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readInstantaneousReactiveCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementInstantaneousReactiveCurrentCommandParams - ); - result.put("readInstantaneousReactiveCurrentAttribute", readElectricalMeasurementInstantaneousReactiveCurrentAttributeInteractionInfo); - Map readElectricalMeasurementInstantaneousPowerCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementInstantaneousPowerAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readInstantaneousPowerAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementInstantaneousPowerCommandParams - ); - result.put("readInstantaneousPowerAttribute", readElectricalMeasurementInstantaneousPowerAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltageAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageCommandParams - ); - result.put("readRmsVoltageAttribute", readElectricalMeasurementRmsVoltageAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageMinCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageMinAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltageMinAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageMinCommandParams - ); - result.put("readRmsVoltageMinAttribute", readElectricalMeasurementRmsVoltageMinAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageMaxCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageMaxAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltageMaxAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageMaxCommandParams - ); - result.put("readRmsVoltageMaxAttribute", readElectricalMeasurementRmsVoltageMaxAttributeInteractionInfo); - Map readElectricalMeasurementRmsCurrentCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsCurrentAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsCurrentAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsCurrentCommandParams - ); - result.put("readRmsCurrentAttribute", readElectricalMeasurementRmsCurrentAttributeInteractionInfo); - Map readElectricalMeasurementRmsCurrentMinCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsCurrentMinAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsCurrentMinAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsCurrentMinCommandParams - ); - result.put("readRmsCurrentMinAttribute", readElectricalMeasurementRmsCurrentMinAttributeInteractionInfo); - Map readElectricalMeasurementRmsCurrentMaxCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsCurrentMaxAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsCurrentMaxAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsCurrentMaxCommandParams - ); - result.put("readRmsCurrentMaxAttribute", readElectricalMeasurementRmsCurrentMaxAttributeInteractionInfo); - Map readElectricalMeasurementActivePowerCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementActivePowerAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readActivePowerAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementActivePowerCommandParams - ); - result.put("readActivePowerAttribute", readElectricalMeasurementActivePowerAttributeInteractionInfo); - Map readElectricalMeasurementActivePowerMinCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementActivePowerMinAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readActivePowerMinAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementActivePowerMinCommandParams - ); - result.put("readActivePowerMinAttribute", readElectricalMeasurementActivePowerMinAttributeInteractionInfo); - Map readElectricalMeasurementActivePowerMaxCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementActivePowerMaxAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readActivePowerMaxAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementActivePowerMaxCommandParams - ); - result.put("readActivePowerMaxAttribute", readElectricalMeasurementActivePowerMaxAttributeInteractionInfo); - Map readElectricalMeasurementReactivePowerCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementReactivePowerAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readReactivePowerAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementReactivePowerCommandParams - ); - result.put("readReactivePowerAttribute", readElectricalMeasurementReactivePowerAttributeInteractionInfo); - Map readElectricalMeasurementApparentPowerCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementApparentPowerAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readApparentPowerAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementApparentPowerCommandParams - ); - result.put("readApparentPowerAttribute", readElectricalMeasurementApparentPowerAttributeInteractionInfo); - Map readElectricalMeasurementPowerFactorCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementPowerFactorAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readPowerFactorAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementPowerFactorCommandParams - ); - result.put("readPowerFactorAttribute", readElectricalMeasurementPowerFactorAttributeInteractionInfo); - Map readElectricalMeasurementAverageRmsVoltageMeasurementPeriodCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAverageRmsVoltageMeasurementPeriodAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAverageRmsVoltageMeasurementPeriodAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAverageRmsVoltageMeasurementPeriodCommandParams - ); - result.put("readAverageRmsVoltageMeasurementPeriodAttribute", readElectricalMeasurementAverageRmsVoltageMeasurementPeriodAttributeInteractionInfo); - Map readElectricalMeasurementAverageRmsUnderVoltageCounterCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAverageRmsUnderVoltageCounterAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAverageRmsUnderVoltageCounterAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAverageRmsUnderVoltageCounterCommandParams - ); - result.put("readAverageRmsUnderVoltageCounterAttribute", readElectricalMeasurementAverageRmsUnderVoltageCounterAttributeInteractionInfo); - Map readElectricalMeasurementRmsExtremeOverVoltagePeriodCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsExtremeOverVoltagePeriodAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsExtremeOverVoltagePeriodAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsExtremeOverVoltagePeriodCommandParams - ); - result.put("readRmsExtremeOverVoltagePeriodAttribute", readElectricalMeasurementRmsExtremeOverVoltagePeriodAttributeInteractionInfo); - Map readElectricalMeasurementRmsExtremeUnderVoltagePeriodCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsExtremeUnderVoltagePeriodAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsExtremeUnderVoltagePeriodAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsExtremeUnderVoltagePeriodCommandParams - ); - result.put("readRmsExtremeUnderVoltagePeriodAttribute", readElectricalMeasurementRmsExtremeUnderVoltagePeriodAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageSagPeriodCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageSagPeriodAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltageSagPeriodAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageSagPeriodCommandParams - ); - result.put("readRmsVoltageSagPeriodAttribute", readElectricalMeasurementRmsVoltageSagPeriodAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageSwellPeriodCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageSwellPeriodAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltageSwellPeriodAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageSwellPeriodCommandParams - ); - result.put("readRmsVoltageSwellPeriodAttribute", readElectricalMeasurementRmsVoltageSwellPeriodAttributeInteractionInfo); - Map readElectricalMeasurementAcVoltageMultiplierCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcVoltageMultiplierAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcVoltageMultiplierAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcVoltageMultiplierCommandParams - ); - result.put("readAcVoltageMultiplierAttribute", readElectricalMeasurementAcVoltageMultiplierAttributeInteractionInfo); - Map readElectricalMeasurementAcVoltageDivisorCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcVoltageDivisorAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcVoltageDivisorAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcVoltageDivisorCommandParams - ); - result.put("readAcVoltageDivisorAttribute", readElectricalMeasurementAcVoltageDivisorAttributeInteractionInfo); - Map readElectricalMeasurementAcCurrentMultiplierCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcCurrentMultiplierAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcCurrentMultiplierAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcCurrentMultiplierCommandParams - ); - result.put("readAcCurrentMultiplierAttribute", readElectricalMeasurementAcCurrentMultiplierAttributeInteractionInfo); - Map readElectricalMeasurementAcCurrentDivisorCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcCurrentDivisorAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcCurrentDivisorAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcCurrentDivisorCommandParams - ); - result.put("readAcCurrentDivisorAttribute", readElectricalMeasurementAcCurrentDivisorAttributeInteractionInfo); - Map readElectricalMeasurementAcPowerMultiplierCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcPowerMultiplierAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcPowerMultiplierAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcPowerMultiplierCommandParams - ); - result.put("readAcPowerMultiplierAttribute", readElectricalMeasurementAcPowerMultiplierAttributeInteractionInfo); - Map readElectricalMeasurementAcPowerDivisorCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcPowerDivisorAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcPowerDivisorAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcPowerDivisorCommandParams - ); - result.put("readAcPowerDivisorAttribute", readElectricalMeasurementAcPowerDivisorAttributeInteractionInfo); - Map readElectricalMeasurementOverloadAlarmsMaskCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementOverloadAlarmsMaskAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readOverloadAlarmsMaskAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementOverloadAlarmsMaskCommandParams - ); - result.put("readOverloadAlarmsMaskAttribute", readElectricalMeasurementOverloadAlarmsMaskAttributeInteractionInfo); - Map readElectricalMeasurementVoltageOverloadCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementVoltageOverloadAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readVoltageOverloadAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementVoltageOverloadCommandParams - ); - result.put("readVoltageOverloadAttribute", readElectricalMeasurementVoltageOverloadAttributeInteractionInfo); - Map readElectricalMeasurementCurrentOverloadCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementCurrentOverloadAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readCurrentOverloadAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementCurrentOverloadCommandParams - ); - result.put("readCurrentOverloadAttribute", readElectricalMeasurementCurrentOverloadAttributeInteractionInfo); - Map readElectricalMeasurementAcOverloadAlarmsMaskCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcOverloadAlarmsMaskAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcOverloadAlarmsMaskAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcOverloadAlarmsMaskCommandParams - ); - result.put("readAcOverloadAlarmsMaskAttribute", readElectricalMeasurementAcOverloadAlarmsMaskAttributeInteractionInfo); - Map readElectricalMeasurementAcVoltageOverloadCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcVoltageOverloadAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcVoltageOverloadAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcVoltageOverloadCommandParams - ); - result.put("readAcVoltageOverloadAttribute", readElectricalMeasurementAcVoltageOverloadAttributeInteractionInfo); - Map readElectricalMeasurementAcCurrentOverloadCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcCurrentOverloadAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcCurrentOverloadAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcCurrentOverloadCommandParams - ); - result.put("readAcCurrentOverloadAttribute", readElectricalMeasurementAcCurrentOverloadAttributeInteractionInfo); - Map readElectricalMeasurementAcActivePowerOverloadCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcActivePowerOverloadAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcActivePowerOverloadAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcActivePowerOverloadCommandParams - ); - result.put("readAcActivePowerOverloadAttribute", readElectricalMeasurementAcActivePowerOverloadAttributeInteractionInfo); - Map readElectricalMeasurementAcReactivePowerOverloadCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcReactivePowerOverloadAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcReactivePowerOverloadAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAcReactivePowerOverloadCommandParams - ); - result.put("readAcReactivePowerOverloadAttribute", readElectricalMeasurementAcReactivePowerOverloadAttributeInteractionInfo); - Map readElectricalMeasurementAverageRmsOverVoltageCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAverageRmsOverVoltageAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAverageRmsOverVoltageAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAverageRmsOverVoltageCommandParams - ); - result.put("readAverageRmsOverVoltageAttribute", readElectricalMeasurementAverageRmsOverVoltageAttributeInteractionInfo); - Map readElectricalMeasurementAverageRmsUnderVoltageCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAverageRmsUnderVoltageAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAverageRmsUnderVoltageAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAverageRmsUnderVoltageCommandParams - ); - result.put("readAverageRmsUnderVoltageAttribute", readElectricalMeasurementAverageRmsUnderVoltageAttributeInteractionInfo); - Map readElectricalMeasurementRmsExtremeOverVoltageCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsExtremeOverVoltageAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsExtremeOverVoltageAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsExtremeOverVoltageCommandParams - ); - result.put("readRmsExtremeOverVoltageAttribute", readElectricalMeasurementRmsExtremeOverVoltageAttributeInteractionInfo); - Map readElectricalMeasurementRmsExtremeUnderVoltageCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsExtremeUnderVoltageAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsExtremeUnderVoltageAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsExtremeUnderVoltageCommandParams - ); - result.put("readRmsExtremeUnderVoltageAttribute", readElectricalMeasurementRmsExtremeUnderVoltageAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageSagCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageSagAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltageSagAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageSagCommandParams - ); - result.put("readRmsVoltageSagAttribute", readElectricalMeasurementRmsVoltageSagAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageSwellCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageSwellAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltageSwellAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageSwellCommandParams - ); - result.put("readRmsVoltageSwellAttribute", readElectricalMeasurementRmsVoltageSwellAttributeInteractionInfo); - Map readElectricalMeasurementLineCurrentPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementLineCurrentPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readLineCurrentPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementLineCurrentPhaseBCommandParams - ); - result.put("readLineCurrentPhaseBAttribute", readElectricalMeasurementLineCurrentPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementActiveCurrentPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementActiveCurrentPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readActiveCurrentPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementActiveCurrentPhaseBCommandParams - ); - result.put("readActiveCurrentPhaseBAttribute", readElectricalMeasurementActiveCurrentPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementReactiveCurrentPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementReactiveCurrentPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readReactiveCurrentPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementReactiveCurrentPhaseBCommandParams - ); - result.put("readReactiveCurrentPhaseBAttribute", readElectricalMeasurementReactiveCurrentPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltagePhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltagePhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltagePhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltagePhaseBCommandParams - ); - result.put("readRmsVoltagePhaseBAttribute", readElectricalMeasurementRmsVoltagePhaseBAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageMinPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageMinPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltageMinPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageMinPhaseBCommandParams - ); - result.put("readRmsVoltageMinPhaseBAttribute", readElectricalMeasurementRmsVoltageMinPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageMaxPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageMaxPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltageMaxPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageMaxPhaseBCommandParams - ); - result.put("readRmsVoltageMaxPhaseBAttribute", readElectricalMeasurementRmsVoltageMaxPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementRmsCurrentPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsCurrentPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsCurrentPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsCurrentPhaseBCommandParams - ); - result.put("readRmsCurrentPhaseBAttribute", readElectricalMeasurementRmsCurrentPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementRmsCurrentMinPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsCurrentMinPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsCurrentMinPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsCurrentMinPhaseBCommandParams - ); - result.put("readRmsCurrentMinPhaseBAttribute", readElectricalMeasurementRmsCurrentMinPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementRmsCurrentMaxPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsCurrentMaxPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsCurrentMaxPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsCurrentMaxPhaseBCommandParams - ); - result.put("readRmsCurrentMaxPhaseBAttribute", readElectricalMeasurementRmsCurrentMaxPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementActivePowerPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementActivePowerPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readActivePowerPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementActivePowerPhaseBCommandParams - ); - result.put("readActivePowerPhaseBAttribute", readElectricalMeasurementActivePowerPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementActivePowerMinPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementActivePowerMinPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readActivePowerMinPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementActivePowerMinPhaseBCommandParams - ); - result.put("readActivePowerMinPhaseBAttribute", readElectricalMeasurementActivePowerMinPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementActivePowerMaxPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementActivePowerMaxPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readActivePowerMaxPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementActivePowerMaxPhaseBCommandParams - ); - result.put("readActivePowerMaxPhaseBAttribute", readElectricalMeasurementActivePowerMaxPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementReactivePowerPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementReactivePowerPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readReactivePowerPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementReactivePowerPhaseBCommandParams - ); - result.put("readReactivePowerPhaseBAttribute", readElectricalMeasurementReactivePowerPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementApparentPowerPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementApparentPowerPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readApparentPowerPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementApparentPowerPhaseBCommandParams - ); - result.put("readApparentPowerPhaseBAttribute", readElectricalMeasurementApparentPowerPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementPowerFactorPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementPowerFactorPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readPowerFactorPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementPowerFactorPhaseBCommandParams - ); - result.put("readPowerFactorPhaseBAttribute", readElectricalMeasurementPowerFactorPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAverageRmsVoltageMeasurementPeriodPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseBCommandParams - ); - result.put("readAverageRmsVoltageMeasurementPeriodPhaseBAttribute", readElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementAverageRmsOverVoltageCounterPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAverageRmsOverVoltageCounterPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAverageRmsOverVoltageCounterPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAverageRmsOverVoltageCounterPhaseBCommandParams - ); - result.put("readAverageRmsOverVoltageCounterPhaseBAttribute", readElectricalMeasurementAverageRmsOverVoltageCounterPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementAverageRmsUnderVoltageCounterPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAverageRmsUnderVoltageCounterPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAverageRmsUnderVoltageCounterPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAverageRmsUnderVoltageCounterPhaseBCommandParams - ); - result.put("readAverageRmsUnderVoltageCounterPhaseBAttribute", readElectricalMeasurementAverageRmsUnderVoltageCounterPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsExtremeOverVoltagePeriodPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseBCommandParams - ); - result.put("readRmsExtremeOverVoltagePeriodPhaseBAttribute", readElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsExtremeUnderVoltagePeriodPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseBCommandParams - ); - result.put("readRmsExtremeUnderVoltagePeriodPhaseBAttribute", readElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageSagPeriodPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageSagPeriodPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltageSagPeriodPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageSagPeriodPhaseBCommandParams - ); - result.put("readRmsVoltageSagPeriodPhaseBAttribute", readElectricalMeasurementRmsVoltageSagPeriodPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageSwellPeriodPhaseBCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageSwellPeriodPhaseBAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltageSwellPeriodPhaseBAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageSwellPeriodPhaseBCommandParams - ); - result.put("readRmsVoltageSwellPeriodPhaseBAttribute", readElectricalMeasurementRmsVoltageSwellPeriodPhaseBAttributeInteractionInfo); - Map readElectricalMeasurementLineCurrentPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementLineCurrentPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readLineCurrentPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementLineCurrentPhaseCCommandParams - ); - result.put("readLineCurrentPhaseCAttribute", readElectricalMeasurementLineCurrentPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementActiveCurrentPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementActiveCurrentPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readActiveCurrentPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementActiveCurrentPhaseCCommandParams - ); - result.put("readActiveCurrentPhaseCAttribute", readElectricalMeasurementActiveCurrentPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementReactiveCurrentPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementReactiveCurrentPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readReactiveCurrentPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementReactiveCurrentPhaseCCommandParams - ); - result.put("readReactiveCurrentPhaseCAttribute", readElectricalMeasurementReactiveCurrentPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltagePhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltagePhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltagePhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltagePhaseCCommandParams - ); - result.put("readRmsVoltagePhaseCAttribute", readElectricalMeasurementRmsVoltagePhaseCAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageMinPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageMinPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltageMinPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageMinPhaseCCommandParams - ); - result.put("readRmsVoltageMinPhaseCAttribute", readElectricalMeasurementRmsVoltageMinPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageMaxPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageMaxPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltageMaxPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageMaxPhaseCCommandParams - ); - result.put("readRmsVoltageMaxPhaseCAttribute", readElectricalMeasurementRmsVoltageMaxPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementRmsCurrentPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsCurrentPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsCurrentPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsCurrentPhaseCCommandParams - ); - result.put("readRmsCurrentPhaseCAttribute", readElectricalMeasurementRmsCurrentPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementRmsCurrentMinPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsCurrentMinPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsCurrentMinPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsCurrentMinPhaseCCommandParams - ); - result.put("readRmsCurrentMinPhaseCAttribute", readElectricalMeasurementRmsCurrentMinPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementRmsCurrentMaxPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsCurrentMaxPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsCurrentMaxPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsCurrentMaxPhaseCCommandParams - ); - result.put("readRmsCurrentMaxPhaseCAttribute", readElectricalMeasurementRmsCurrentMaxPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementActivePowerPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementActivePowerPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readActivePowerPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementActivePowerPhaseCCommandParams - ); - result.put("readActivePowerPhaseCAttribute", readElectricalMeasurementActivePowerPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementActivePowerMinPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementActivePowerMinPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readActivePowerMinPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementActivePowerMinPhaseCCommandParams - ); - result.put("readActivePowerMinPhaseCAttribute", readElectricalMeasurementActivePowerMinPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementActivePowerMaxPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementActivePowerMaxPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readActivePowerMaxPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementActivePowerMaxPhaseCCommandParams - ); - result.put("readActivePowerMaxPhaseCAttribute", readElectricalMeasurementActivePowerMaxPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementReactivePowerPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementReactivePowerPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readReactivePowerPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementReactivePowerPhaseCCommandParams - ); - result.put("readReactivePowerPhaseCAttribute", readElectricalMeasurementReactivePowerPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementApparentPowerPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementApparentPowerPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readApparentPowerPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementApparentPowerPhaseCCommandParams - ); - result.put("readApparentPowerPhaseCAttribute", readElectricalMeasurementApparentPowerPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementPowerFactorPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementPowerFactorPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readPowerFactorPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementPowerFactorPhaseCCommandParams - ); - result.put("readPowerFactorPhaseCAttribute", readElectricalMeasurementPowerFactorPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAverageRmsVoltageMeasurementPeriodPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseCCommandParams - ); - result.put("readAverageRmsVoltageMeasurementPeriodPhaseCAttribute", readElectricalMeasurementAverageRmsVoltageMeasurementPeriodPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementAverageRmsOverVoltageCounterPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAverageRmsOverVoltageCounterPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAverageRmsOverVoltageCounterPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAverageRmsOverVoltageCounterPhaseCCommandParams - ); - result.put("readAverageRmsOverVoltageCounterPhaseCAttribute", readElectricalMeasurementAverageRmsOverVoltageCounterPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementAverageRmsUnderVoltageCounterPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAverageRmsUnderVoltageCounterPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAverageRmsUnderVoltageCounterPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementAverageRmsUnderVoltageCounterPhaseCCommandParams - ); - result.put("readAverageRmsUnderVoltageCounterPhaseCAttribute", readElectricalMeasurementAverageRmsUnderVoltageCounterPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsExtremeOverVoltagePeriodPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseCCommandParams - ); - result.put("readRmsExtremeOverVoltagePeriodPhaseCAttribute", readElectricalMeasurementRmsExtremeOverVoltagePeriodPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsExtremeUnderVoltagePeriodPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseCCommandParams - ); - result.put("readRmsExtremeUnderVoltagePeriodPhaseCAttribute", readElectricalMeasurementRmsExtremeUnderVoltagePeriodPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageSagPeriodPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageSagPeriodPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltageSagPeriodPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageSagPeriodPhaseCCommandParams - ); - result.put("readRmsVoltageSagPeriodPhaseCAttribute", readElectricalMeasurementRmsVoltageSagPeriodPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementRmsVoltageSwellPeriodPhaseCCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementRmsVoltageSwellPeriodPhaseCAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readRmsVoltageSwellPeriodPhaseCAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementRmsVoltageSwellPeriodPhaseCCommandParams - ); - result.put("readRmsVoltageSwellPeriodPhaseCAttribute", readElectricalMeasurementRmsVoltageSwellPeriodPhaseCAttributeInteractionInfo); - Map readElectricalMeasurementGeneratedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementGeneratedCommandListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readGeneratedCommandListAttribute( - (ChipClusters.ElectricalMeasurementCluster.GeneratedCommandListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedElectricalMeasurementClusterGeneratedCommandListAttributeCallback(), - readElectricalMeasurementGeneratedCommandListCommandParams - ); - result.put("readGeneratedCommandListAttribute", readElectricalMeasurementGeneratedCommandListAttributeInteractionInfo); - Map readElectricalMeasurementAcceptedCommandListCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAcceptedCommandListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAcceptedCommandListAttribute( - (ChipClusters.ElectricalMeasurementCluster.AcceptedCommandListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedElectricalMeasurementClusterAcceptedCommandListAttributeCallback(), - readElectricalMeasurementAcceptedCommandListCommandParams - ); - result.put("readAcceptedCommandListAttribute", readElectricalMeasurementAcceptedCommandListAttributeInteractionInfo); - Map readElectricalMeasurementEventListCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementEventListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readEventListAttribute( - (ChipClusters.ElectricalMeasurementCluster.EventListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedElectricalMeasurementClusterEventListAttributeCallback(), - readElectricalMeasurementEventListCommandParams - ); - result.put("readEventListAttribute", readElectricalMeasurementEventListAttributeInteractionInfo); - Map readElectricalMeasurementAttributeListCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementAttributeListAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readAttributeListAttribute( - (ChipClusters.ElectricalMeasurementCluster.AttributeListAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedElectricalMeasurementClusterAttributeListAttributeCallback(), - readElectricalMeasurementAttributeListCommandParams - ); - result.put("readAttributeListAttribute", readElectricalMeasurementAttributeListAttributeInteractionInfo); - Map readElectricalMeasurementFeatureMapCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementFeatureMapAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readFeatureMapAttribute( - (ChipClusters.LongAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedLongAttributeCallback(), - readElectricalMeasurementFeatureMapCommandParams - ); - result.put("readFeatureMapAttribute", readElectricalMeasurementFeatureMapAttributeInteractionInfo); - Map readElectricalMeasurementClusterRevisionCommandParams = new LinkedHashMap(); - InteractionInfo readElectricalMeasurementClusterRevisionAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).readClusterRevisionAttribute( - (ChipClusters.IntegerAttributeCallback) callback - ); - }, - () -> new ClusterInfoMapping.DelegatedIntegerAttributeCallback(), - readElectricalMeasurementClusterRevisionCommandParams - ); - result.put("readClusterRevisionAttribute", readElectricalMeasurementClusterRevisionAttributeInteractionInfo); - - return result; - } private static Map readUnitTestingInteractionInfo() { Map result = new LinkedHashMap<>();Map readUnitTestingBooleanCommandParams = new LinkedHashMap(); InteractionInfo readUnitTestingBooleanAttributeInteractionInfo = new InteractionInfo( @@ -21491,9 +19572,7 @@ public Map> getReadAttributeMap() { put("identify", readIdentifyInteractionInfo()); put("groups", readGroupsInteractionInfo()); put("onOff", readOnOffInteractionInfo()); - put("onOffSwitchConfiguration", readOnOffSwitchConfigurationInteractionInfo()); put("levelControl", readLevelControlInteractionInfo()); - put("binaryInputBasic", readBinaryInputBasicInteractionInfo()); put("pulseWidthModulation", readPulseWidthModulationInteractionInfo()); put("descriptor", readDescriptorInteractionInfo()); put("binding", readBindingInteractionInfo()); @@ -21567,7 +19646,6 @@ public Map> getReadAttributeMap() { put("deviceEnergyManagementMode", readDeviceEnergyManagementModeInteractionInfo()); put("doorLock", readDoorLockInteractionInfo()); put("windowCovering", readWindowCoveringInteractionInfo()); - put("barrierControl", readBarrierControlInteractionInfo()); put("serviceArea", readServiceAreaInteractionInfo()); put("pumpConfigurationAndControl", readPumpConfigurationAndControlInteractionInfo()); put("thermostat", readThermostatInteractionInfo()); @@ -21610,7 +19688,6 @@ public Map> getReadAttributeMap() { put("contentAppObserver", readContentAppObserverInteractionInfo()); put("ecosystemInformation", readEcosystemInformationInteractionInfo()); put("commissionerControl", readCommissionerControlInteractionInfo()); - put("electricalMeasurement", readElectricalMeasurementInteractionInfo()); put("unitTesting", readUnitTestingInteractionInfo()); put("faultInjection", readFaultInjectionInteractionInfo()); put("sampleMei", readSampleMeiInteractionInfo());}}; diff --git a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java index 0a59b42a9ffe34..b61658cc4ef211 100644 --- a/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java +++ b/src/controller/java/generated/java/chip/devicecontroller/ClusterWriteMapping.java @@ -120,30 +120,6 @@ public Map> getWriteAttributeMap() { ); writeOnOffInteractionInfo.put("writeStartUpOnOffAttribute", writeOnOffStartUpOnOffAttributeInteractionInfo); writeAttributeMap.put("onOff", writeOnOffInteractionInfo); - Map writeOnOffSwitchConfigurationInteractionInfo = new LinkedHashMap<>(); - Map writeOnOffSwitchConfigurationSwitchActionsCommandParams = new LinkedHashMap(); - CommandParameterInfo onOffSwitchConfigurationswitchActionsCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeOnOffSwitchConfigurationSwitchActionsCommandParams.put( - "value", - onOffSwitchConfigurationswitchActionsCommandParameterInfo - ); - InteractionInfo writeOnOffSwitchConfigurationSwitchActionsAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.OnOffSwitchConfigurationCluster) cluster).writeSwitchActionsAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeOnOffSwitchConfigurationSwitchActionsCommandParams - ); - writeOnOffSwitchConfigurationInteractionInfo.put("writeSwitchActionsAttribute", writeOnOffSwitchConfigurationSwitchActionsAttributeInteractionInfo); - writeAttributeMap.put("onOffSwitchConfiguration", writeOnOffSwitchConfigurationInteractionInfo); Map writeLevelControlInteractionInfo = new LinkedHashMap<>(); Map writeLevelControlOptionsCommandParams = new LinkedHashMap(); CommandParameterInfo levelControloptionsCommandParameterInfo = @@ -300,140 +276,6 @@ public Map> getWriteAttributeMap() { ); writeLevelControlInteractionInfo.put("writeStartUpCurrentLevelAttribute", writeLevelControlStartUpCurrentLevelAttributeInteractionInfo); writeAttributeMap.put("levelControl", writeLevelControlInteractionInfo); - Map writeBinaryInputBasicInteractionInfo = new LinkedHashMap<>(); - Map writeBinaryInputBasicActiveTextCommandParams = new LinkedHashMap(); - CommandParameterInfo binaryInputBasicactiveTextCommandParameterInfo = - new CommandParameterInfo( - "value", - String.class, - String.class - ); - writeBinaryInputBasicActiveTextCommandParams.put( - "value", - binaryInputBasicactiveTextCommandParameterInfo - ); - InteractionInfo writeBinaryInputBasicActiveTextAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).writeActiveTextAttribute( - (DefaultClusterCallback) callback, - (String) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeBinaryInputBasicActiveTextCommandParams - ); - writeBinaryInputBasicInteractionInfo.put("writeActiveTextAttribute", writeBinaryInputBasicActiveTextAttributeInteractionInfo); - Map writeBinaryInputBasicDescriptionCommandParams = new LinkedHashMap(); - CommandParameterInfo binaryInputBasicdescriptionCommandParameterInfo = - new CommandParameterInfo( - "value", - String.class, - String.class - ); - writeBinaryInputBasicDescriptionCommandParams.put( - "value", - binaryInputBasicdescriptionCommandParameterInfo - ); - InteractionInfo writeBinaryInputBasicDescriptionAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).writeDescriptionAttribute( - (DefaultClusterCallback) callback, - (String) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeBinaryInputBasicDescriptionCommandParams - ); - writeBinaryInputBasicInteractionInfo.put("writeDescriptionAttribute", writeBinaryInputBasicDescriptionAttributeInteractionInfo); - Map writeBinaryInputBasicInactiveTextCommandParams = new LinkedHashMap(); - CommandParameterInfo binaryInputBasicinactiveTextCommandParameterInfo = - new CommandParameterInfo( - "value", - String.class, - String.class - ); - writeBinaryInputBasicInactiveTextCommandParams.put( - "value", - binaryInputBasicinactiveTextCommandParameterInfo - ); - InteractionInfo writeBinaryInputBasicInactiveTextAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).writeInactiveTextAttribute( - (DefaultClusterCallback) callback, - (String) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeBinaryInputBasicInactiveTextCommandParams - ); - writeBinaryInputBasicInteractionInfo.put("writeInactiveTextAttribute", writeBinaryInputBasicInactiveTextAttributeInteractionInfo); - Map writeBinaryInputBasicOutOfServiceCommandParams = new LinkedHashMap(); - CommandParameterInfo binaryInputBasicoutOfServiceCommandParameterInfo = - new CommandParameterInfo( - "value", - Boolean.class, - Boolean.class - ); - writeBinaryInputBasicOutOfServiceCommandParams.put( - "value", - binaryInputBasicoutOfServiceCommandParameterInfo - ); - InteractionInfo writeBinaryInputBasicOutOfServiceAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).writeOutOfServiceAttribute( - (DefaultClusterCallback) callback, - (Boolean) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeBinaryInputBasicOutOfServiceCommandParams - ); - writeBinaryInputBasicInteractionInfo.put("writeOutOfServiceAttribute", writeBinaryInputBasicOutOfServiceAttributeInteractionInfo); - Map writeBinaryInputBasicPresentValueCommandParams = new LinkedHashMap(); - CommandParameterInfo binaryInputBasicpresentValueCommandParameterInfo = - new CommandParameterInfo( - "value", - Boolean.class, - Boolean.class - ); - writeBinaryInputBasicPresentValueCommandParams.put( - "value", - binaryInputBasicpresentValueCommandParameterInfo - ); - InteractionInfo writeBinaryInputBasicPresentValueAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).writePresentValueAttribute( - (DefaultClusterCallback) callback, - (Boolean) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeBinaryInputBasicPresentValueCommandParams - ); - writeBinaryInputBasicInteractionInfo.put("writePresentValueAttribute", writeBinaryInputBasicPresentValueAttributeInteractionInfo); - Map writeBinaryInputBasicReliabilityCommandParams = new LinkedHashMap(); - CommandParameterInfo binaryInputBasicreliabilityCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeBinaryInputBasicReliabilityCommandParams.put( - "value", - binaryInputBasicreliabilityCommandParameterInfo - ); - InteractionInfo writeBinaryInputBasicReliabilityAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BinaryInputBasicCluster) cluster).writeReliabilityAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeBinaryInputBasicReliabilityCommandParams - ); - writeBinaryInputBasicInteractionInfo.put("writeReliabilityAttribute", writeBinaryInputBasicReliabilityAttributeInteractionInfo); - writeAttributeMap.put("binaryInputBasic", writeBinaryInputBasicInteractionInfo); Map writePulseWidthModulationInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("pulseWidthModulation", writePulseWidthModulationInteractionInfo); Map writeDescriptorInteractionInfo = new LinkedHashMap<>(); @@ -1922,140 +1764,6 @@ public Map> getWriteAttributeMap() { ); writeWindowCoveringInteractionInfo.put("writeModeAttribute", writeWindowCoveringModeAttributeInteractionInfo); writeAttributeMap.put("windowCovering", writeWindowCoveringInteractionInfo); - Map writeBarrierControlInteractionInfo = new LinkedHashMap<>(); - Map writeBarrierControlBarrierOpenEventsCommandParams = new LinkedHashMap(); - CommandParameterInfo barrierControlbarrierOpenEventsCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeBarrierControlBarrierOpenEventsCommandParams.put( - "value", - barrierControlbarrierOpenEventsCommandParameterInfo - ); - InteractionInfo writeBarrierControlBarrierOpenEventsAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).writeBarrierOpenEventsAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeBarrierControlBarrierOpenEventsCommandParams - ); - writeBarrierControlInteractionInfo.put("writeBarrierOpenEventsAttribute", writeBarrierControlBarrierOpenEventsAttributeInteractionInfo); - Map writeBarrierControlBarrierCloseEventsCommandParams = new LinkedHashMap(); - CommandParameterInfo barrierControlbarrierCloseEventsCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeBarrierControlBarrierCloseEventsCommandParams.put( - "value", - barrierControlbarrierCloseEventsCommandParameterInfo - ); - InteractionInfo writeBarrierControlBarrierCloseEventsAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).writeBarrierCloseEventsAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeBarrierControlBarrierCloseEventsCommandParams - ); - writeBarrierControlInteractionInfo.put("writeBarrierCloseEventsAttribute", writeBarrierControlBarrierCloseEventsAttributeInteractionInfo); - Map writeBarrierControlBarrierCommandOpenEventsCommandParams = new LinkedHashMap(); - CommandParameterInfo barrierControlbarrierCommandOpenEventsCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeBarrierControlBarrierCommandOpenEventsCommandParams.put( - "value", - barrierControlbarrierCommandOpenEventsCommandParameterInfo - ); - InteractionInfo writeBarrierControlBarrierCommandOpenEventsAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).writeBarrierCommandOpenEventsAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeBarrierControlBarrierCommandOpenEventsCommandParams - ); - writeBarrierControlInteractionInfo.put("writeBarrierCommandOpenEventsAttribute", writeBarrierControlBarrierCommandOpenEventsAttributeInteractionInfo); - Map writeBarrierControlBarrierCommandCloseEventsCommandParams = new LinkedHashMap(); - CommandParameterInfo barrierControlbarrierCommandCloseEventsCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeBarrierControlBarrierCommandCloseEventsCommandParams.put( - "value", - barrierControlbarrierCommandCloseEventsCommandParameterInfo - ); - InteractionInfo writeBarrierControlBarrierCommandCloseEventsAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).writeBarrierCommandCloseEventsAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeBarrierControlBarrierCommandCloseEventsCommandParams - ); - writeBarrierControlInteractionInfo.put("writeBarrierCommandCloseEventsAttribute", writeBarrierControlBarrierCommandCloseEventsAttributeInteractionInfo); - Map writeBarrierControlBarrierOpenPeriodCommandParams = new LinkedHashMap(); - CommandParameterInfo barrierControlbarrierOpenPeriodCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeBarrierControlBarrierOpenPeriodCommandParams.put( - "value", - barrierControlbarrierOpenPeriodCommandParameterInfo - ); - InteractionInfo writeBarrierControlBarrierOpenPeriodAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).writeBarrierOpenPeriodAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeBarrierControlBarrierOpenPeriodCommandParams - ); - writeBarrierControlInteractionInfo.put("writeBarrierOpenPeriodAttribute", writeBarrierControlBarrierOpenPeriodAttributeInteractionInfo); - Map writeBarrierControlBarrierClosePeriodCommandParams = new LinkedHashMap(); - CommandParameterInfo barrierControlbarrierClosePeriodCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeBarrierControlBarrierClosePeriodCommandParams.put( - "value", - barrierControlbarrierClosePeriodCommandParameterInfo - ); - InteractionInfo writeBarrierControlBarrierClosePeriodAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.BarrierControlCluster) cluster).writeBarrierClosePeriodAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeBarrierControlBarrierClosePeriodCommandParams - ); - writeBarrierControlInteractionInfo.put("writeBarrierClosePeriodAttribute", writeBarrierControlBarrierClosePeriodAttributeInteractionInfo); - writeAttributeMap.put("barrierControl", writeBarrierControlInteractionInfo); Map writeServiceAreaInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("serviceArea", writeServiceAreaInteractionInfo); Map writePumpConfigurationAndControlInteractionInfo = new LinkedHashMap<>(); @@ -3768,184 +3476,6 @@ public Map> getWriteAttributeMap() { writeAttributeMap.put("ecosystemInformation", writeEcosystemInformationInteractionInfo); Map writeCommissionerControlInteractionInfo = new LinkedHashMap<>(); writeAttributeMap.put("commissionerControl", writeCommissionerControlInteractionInfo); - Map writeElectricalMeasurementInteractionInfo = new LinkedHashMap<>(); - Map writeElectricalMeasurementAverageRmsVoltageMeasurementPeriodCommandParams = new LinkedHashMap(); - CommandParameterInfo electricalMeasurementaverageRmsVoltageMeasurementPeriodCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeElectricalMeasurementAverageRmsVoltageMeasurementPeriodCommandParams.put( - "value", - electricalMeasurementaverageRmsVoltageMeasurementPeriodCommandParameterInfo - ); - InteractionInfo writeElectricalMeasurementAverageRmsVoltageMeasurementPeriodAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).writeAverageRmsVoltageMeasurementPeriodAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeElectricalMeasurementAverageRmsVoltageMeasurementPeriodCommandParams - ); - writeElectricalMeasurementInteractionInfo.put("writeAverageRmsVoltageMeasurementPeriodAttribute", writeElectricalMeasurementAverageRmsVoltageMeasurementPeriodAttributeInteractionInfo); - Map writeElectricalMeasurementAverageRmsUnderVoltageCounterCommandParams = new LinkedHashMap(); - CommandParameterInfo electricalMeasurementaverageRmsUnderVoltageCounterCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeElectricalMeasurementAverageRmsUnderVoltageCounterCommandParams.put( - "value", - electricalMeasurementaverageRmsUnderVoltageCounterCommandParameterInfo - ); - InteractionInfo writeElectricalMeasurementAverageRmsUnderVoltageCounterAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).writeAverageRmsUnderVoltageCounterAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeElectricalMeasurementAverageRmsUnderVoltageCounterCommandParams - ); - writeElectricalMeasurementInteractionInfo.put("writeAverageRmsUnderVoltageCounterAttribute", writeElectricalMeasurementAverageRmsUnderVoltageCounterAttributeInteractionInfo); - Map writeElectricalMeasurementRmsExtremeOverVoltagePeriodCommandParams = new LinkedHashMap(); - CommandParameterInfo electricalMeasurementrmsExtremeOverVoltagePeriodCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeElectricalMeasurementRmsExtremeOverVoltagePeriodCommandParams.put( - "value", - electricalMeasurementrmsExtremeOverVoltagePeriodCommandParameterInfo - ); - InteractionInfo writeElectricalMeasurementRmsExtremeOverVoltagePeriodAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).writeRmsExtremeOverVoltagePeriodAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeElectricalMeasurementRmsExtremeOverVoltagePeriodCommandParams - ); - writeElectricalMeasurementInteractionInfo.put("writeRmsExtremeOverVoltagePeriodAttribute", writeElectricalMeasurementRmsExtremeOverVoltagePeriodAttributeInteractionInfo); - Map writeElectricalMeasurementRmsExtremeUnderVoltagePeriodCommandParams = new LinkedHashMap(); - CommandParameterInfo electricalMeasurementrmsExtremeUnderVoltagePeriodCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeElectricalMeasurementRmsExtremeUnderVoltagePeriodCommandParams.put( - "value", - electricalMeasurementrmsExtremeUnderVoltagePeriodCommandParameterInfo - ); - InteractionInfo writeElectricalMeasurementRmsExtremeUnderVoltagePeriodAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).writeRmsExtremeUnderVoltagePeriodAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeElectricalMeasurementRmsExtremeUnderVoltagePeriodCommandParams - ); - writeElectricalMeasurementInteractionInfo.put("writeRmsExtremeUnderVoltagePeriodAttribute", writeElectricalMeasurementRmsExtremeUnderVoltagePeriodAttributeInteractionInfo); - Map writeElectricalMeasurementRmsVoltageSagPeriodCommandParams = new LinkedHashMap(); - CommandParameterInfo electricalMeasurementrmsVoltageSagPeriodCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeElectricalMeasurementRmsVoltageSagPeriodCommandParams.put( - "value", - electricalMeasurementrmsVoltageSagPeriodCommandParameterInfo - ); - InteractionInfo writeElectricalMeasurementRmsVoltageSagPeriodAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).writeRmsVoltageSagPeriodAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeElectricalMeasurementRmsVoltageSagPeriodCommandParams - ); - writeElectricalMeasurementInteractionInfo.put("writeRmsVoltageSagPeriodAttribute", writeElectricalMeasurementRmsVoltageSagPeriodAttributeInteractionInfo); - Map writeElectricalMeasurementRmsVoltageSwellPeriodCommandParams = new LinkedHashMap(); - CommandParameterInfo electricalMeasurementrmsVoltageSwellPeriodCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeElectricalMeasurementRmsVoltageSwellPeriodCommandParams.put( - "value", - electricalMeasurementrmsVoltageSwellPeriodCommandParameterInfo - ); - InteractionInfo writeElectricalMeasurementRmsVoltageSwellPeriodAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).writeRmsVoltageSwellPeriodAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeElectricalMeasurementRmsVoltageSwellPeriodCommandParams - ); - writeElectricalMeasurementInteractionInfo.put("writeRmsVoltageSwellPeriodAttribute", writeElectricalMeasurementRmsVoltageSwellPeriodAttributeInteractionInfo); - Map writeElectricalMeasurementOverloadAlarmsMaskCommandParams = new LinkedHashMap(); - CommandParameterInfo electricalMeasurementoverloadAlarmsMaskCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeElectricalMeasurementOverloadAlarmsMaskCommandParams.put( - "value", - electricalMeasurementoverloadAlarmsMaskCommandParameterInfo - ); - InteractionInfo writeElectricalMeasurementOverloadAlarmsMaskAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).writeOverloadAlarmsMaskAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeElectricalMeasurementOverloadAlarmsMaskCommandParams - ); - writeElectricalMeasurementInteractionInfo.put("writeOverloadAlarmsMaskAttribute", writeElectricalMeasurementOverloadAlarmsMaskAttributeInteractionInfo); - Map writeElectricalMeasurementAcOverloadAlarmsMaskCommandParams = new LinkedHashMap(); - CommandParameterInfo electricalMeasurementacOverloadAlarmsMaskCommandParameterInfo = - new CommandParameterInfo( - "value", - Integer.class, - Integer.class - ); - writeElectricalMeasurementAcOverloadAlarmsMaskCommandParams.put( - "value", - electricalMeasurementacOverloadAlarmsMaskCommandParameterInfo - ); - InteractionInfo writeElectricalMeasurementAcOverloadAlarmsMaskAttributeInteractionInfo = new InteractionInfo( - (cluster, callback, commandArguments) -> { - ((ChipClusters.ElectricalMeasurementCluster) cluster).writeAcOverloadAlarmsMaskAttribute( - (DefaultClusterCallback) callback, - (Integer) commandArguments.get("value") - ); - }, - () -> new ClusterInfoMapping.DelegatedDefaultClusterCallback(), - writeElectricalMeasurementAcOverloadAlarmsMaskCommandParams - ); - writeElectricalMeasurementInteractionInfo.put("writeAcOverloadAlarmsMaskAttribute", writeElectricalMeasurementAcOverloadAlarmsMaskAttributeInteractionInfo); - writeAttributeMap.put("electricalMeasurement", writeElectricalMeasurementInteractionInfo); Map writeUnitTestingInteractionInfo = new LinkedHashMap<>(); Map writeUnitTestingBooleanCommandParams = new LinkedHashMap(); CommandParameterInfo unitTestingbooleanCommandParameterInfo = diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/BarrierControlCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/BarrierControlCluster.kt deleted file mode 100644 index 1c424199292f41..00000000000000 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/BarrierControlCluster.kt +++ /dev/null @@ -1,1817 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package matter.controller.cluster.clusters - -import java.time.Duration -import java.util.logging.Level -import java.util.logging.Logger -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.transform -import matter.controller.InvokeRequest -import matter.controller.InvokeResponse -import matter.controller.MatterController -import matter.controller.ReadData -import matter.controller.ReadRequest -import matter.controller.SubscribeRequest -import matter.controller.SubscriptionState -import matter.controller.UByteSubscriptionState -import matter.controller.UIntSubscriptionState -import matter.controller.UShortSubscriptionState -import matter.controller.WriteRequest -import matter.controller.WriteRequests -import matter.controller.WriteResponse -import matter.controller.cluster.structs.* -import matter.controller.model.AttributePath -import matter.controller.model.CommandPath -import matter.tlv.AnonymousTag -import matter.tlv.ContextSpecificTag -import matter.tlv.TlvReader -import matter.tlv.TlvWriter - -class BarrierControlCluster( - private val controller: MatterController, - private val endpointId: UShort, -) { - class GeneratedCommandListAttribute(val value: List) - - sealed class GeneratedCommandListAttributeSubscriptionState { - data class Success(val value: List) : GeneratedCommandListAttributeSubscriptionState() - - data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() - - object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() - } - - class AcceptedCommandListAttribute(val value: List) - - sealed class AcceptedCommandListAttributeSubscriptionState { - data class Success(val value: List) : AcceptedCommandListAttributeSubscriptionState() - - data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() - - object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() - } - - class EventListAttribute(val value: List) - - sealed class EventListAttributeSubscriptionState { - data class Success(val value: List) : EventListAttributeSubscriptionState() - - data class Error(val exception: Exception) : EventListAttributeSubscriptionState() - - object SubscriptionEstablished : EventListAttributeSubscriptionState() - } - - class AttributeListAttribute(val value: List) - - sealed class AttributeListAttributeSubscriptionState { - data class Success(val value: List) : AttributeListAttributeSubscriptionState() - - data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() - - object SubscriptionEstablished : AttributeListAttributeSubscriptionState() - } - - suspend fun barrierControlGoToPercent(percentOpen: UByte, timedInvokeTimeout: Duration? = null) { - val commandId: UInt = 0u - - val tlvWriter = TlvWriter() - tlvWriter.startStructure(AnonymousTag) - - val TAG_PERCENT_OPEN_REQ: Int = 0 - tlvWriter.put(ContextSpecificTag(TAG_PERCENT_OPEN_REQ), percentOpen) - tlvWriter.endStructure() - - val request: InvokeRequest = - InvokeRequest( - CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), - tlvPayload = tlvWriter.getEncoded(), - timedRequest = timedInvokeTimeout, - ) - - val response: InvokeResponse = controller.invoke(request) - logger.log(Level.FINE, "Invoke command succeeded: ${response}") - } - - suspend fun barrierControlStop(timedInvokeTimeout: Duration? = null) { - val commandId: UInt = 1u - - val tlvWriter = TlvWriter() - tlvWriter.startStructure(AnonymousTag) - tlvWriter.endStructure() - - val request: InvokeRequest = - InvokeRequest( - CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), - tlvPayload = tlvWriter.getEncoded(), - timedRequest = timedInvokeTimeout, - ) - - val response: InvokeResponse = controller.invoke(request) - logger.log(Level.FINE, "Invoke command succeeded: ${response}") - } - - suspend fun readBarrierMovingStateAttribute(): UByte { - val ATTRIBUTE_ID: UInt = 1u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Barriermovingstate attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) - - return decodedValue - } - - suspend fun subscribeBarrierMovingStateAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UByteSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Barriermovingstate attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) - - emit(UByteSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(UByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readBarrierSafetyStatusAttribute(): UShort { - val ATTRIBUTE_ID: UInt = 2u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Barriersafetystatus attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) - - return decodedValue - } - - suspend fun subscribeBarrierSafetyStatusAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Barriersafetystatus attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) - - emit(UShortSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readBarrierCapabilitiesAttribute(): UByte { - val ATTRIBUTE_ID: UInt = 3u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Barriercapabilities attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) - - return decodedValue - } - - suspend fun subscribeBarrierCapabilitiesAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 3u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UByteSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Barriercapabilities attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) - - emit(UByteSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(UByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readBarrierOpenEventsAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 4u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Barrieropenevents attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeBarrierOpenEventsAttribute(value: UShort, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 4u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeBarrierOpenEventsAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 4u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Barrieropenevents attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readBarrierCloseEventsAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 5u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Barriercloseevents attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeBarrierCloseEventsAttribute(value: UShort, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 5u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeBarrierCloseEventsAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 5u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Barriercloseevents attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readBarrierCommandOpenEventsAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 6u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Barriercommandopenevents attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeBarrierCommandOpenEventsAttribute( - value: UShort, - timedWriteTimeout: Duration? = null, - ) { - val ATTRIBUTE_ID: UInt = 6u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeBarrierCommandOpenEventsAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 6u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Barriercommandopenevents attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readBarrierCommandCloseEventsAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 7u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Barriercommandcloseevents attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeBarrierCommandCloseEventsAttribute( - value: UShort, - timedWriteTimeout: Duration? = null, - ) { - val ATTRIBUTE_ID: UInt = 7u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeBarrierCommandCloseEventsAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 7u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Barriercommandcloseevents attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readBarrierOpenPeriodAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 8u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Barrieropenperiod attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeBarrierOpenPeriodAttribute(value: UShort, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 8u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeBarrierOpenPeriodAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 8u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Barrieropenperiod attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readBarrierClosePeriodAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 9u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Barriercloseperiod attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeBarrierClosePeriodAttribute(value: UShort, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 9u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeBarrierClosePeriodAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 9u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Barriercloseperiod attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readBarrierPositionAttribute(): UByte { - val ATTRIBUTE_ID: UInt = 10u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Barrierposition attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) - - return decodedValue - } - - suspend fun subscribeBarrierPositionAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 10u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UByteSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Barrierposition attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) - - emit(UByteSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(UByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { - val ATTRIBUTE_ID: UInt = 65528u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return GeneratedCommandListAttribute(decodedValue) - } - - suspend fun subscribeGeneratedCommandListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65528u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - GeneratedCommandListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Generatedcommandlist attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { - val ATTRIBUTE_ID: UInt = 65529u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return AcceptedCommandListAttribute(decodedValue) - } - - suspend fun subscribeAcceptedCommandListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65529u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - AcceptedCommandListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acceptedcommandlist attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readEventListAttribute(): EventListAttribute { - val ATTRIBUTE_ID: UInt = 65530u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Eventlist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return EventListAttribute(decodedValue) - } - - suspend fun subscribeEventListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65530u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - EventListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(EventListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(EventListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAttributeListAttribute(): AttributeListAttribute { - val ATTRIBUTE_ID: UInt = 65531u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Attributelist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return AttributeListAttribute(decodedValue) - } - - suspend fun subscribeAttributeListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65531u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - AttributeListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readFeatureMapAttribute(): UInt { - val ATTRIBUTE_ID: UInt = 65532u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Featuremap attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) - - return decodedValue - } - - suspend fun subscribeFeatureMapAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65532u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UIntSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) - - emit(UIntSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(UIntSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readClusterRevisionAttribute(): UShort { - val ATTRIBUTE_ID: UInt = 65533u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Clusterrevision attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) - - return decodedValue - } - - suspend fun subscribeClusterRevisionAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65533u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Clusterrevision attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) - - emit(UShortSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - companion object { - private val logger = Logger.getLogger(BarrierControlCluster::class.java.name) - const val CLUSTER_ID: UInt = 259u - } -} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/BinaryInputBasicCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/BinaryInputBasicCluster.kt deleted file mode 100644 index a3aeb110b47fbc..00000000000000 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/BinaryInputBasicCluster.kt +++ /dev/null @@ -1,1671 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package matter.controller.cluster.clusters - -import java.time.Duration -import java.util.logging.Level -import java.util.logging.Logger -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.transform -import matter.controller.BooleanSubscriptionState -import matter.controller.MatterController -import matter.controller.ReadData -import matter.controller.ReadRequest -import matter.controller.StringSubscriptionState -import matter.controller.SubscribeRequest -import matter.controller.SubscriptionState -import matter.controller.UByteSubscriptionState -import matter.controller.UIntSubscriptionState -import matter.controller.UShortSubscriptionState -import matter.controller.WriteRequest -import matter.controller.WriteRequests -import matter.controller.WriteResponse -import matter.controller.cluster.structs.* -import matter.controller.model.AttributePath -import matter.tlv.AnonymousTag -import matter.tlv.TlvReader -import matter.tlv.TlvWriter - -class BinaryInputBasicCluster( - private val controller: MatterController, - private val endpointId: UShort, -) { - class GeneratedCommandListAttribute(val value: List) - - sealed class GeneratedCommandListAttributeSubscriptionState { - data class Success(val value: List) : GeneratedCommandListAttributeSubscriptionState() - - data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() - - object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() - } - - class AcceptedCommandListAttribute(val value: List) - - sealed class AcceptedCommandListAttributeSubscriptionState { - data class Success(val value: List) : AcceptedCommandListAttributeSubscriptionState() - - data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() - - object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() - } - - class EventListAttribute(val value: List) - - sealed class EventListAttributeSubscriptionState { - data class Success(val value: List) : EventListAttributeSubscriptionState() - - data class Error(val exception: Exception) : EventListAttributeSubscriptionState() - - object SubscriptionEstablished : EventListAttributeSubscriptionState() - } - - class AttributeListAttribute(val value: List) - - sealed class AttributeListAttributeSubscriptionState { - data class Success(val value: List) : AttributeListAttributeSubscriptionState() - - data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() - - object SubscriptionEstablished : AttributeListAttributeSubscriptionState() - } - - suspend fun readActiveTextAttribute(): String? { - val ATTRIBUTE_ID: UInt = 4u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Activetext attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: String? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getString(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeActiveTextAttribute(value: String, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 4u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeActiveTextAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 4u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - StringSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Activetext attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: String? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getString(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(StringSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(StringSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDescriptionAttribute(): String? { - val ATTRIBUTE_ID: UInt = 28u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Description attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: String? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getString(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeDescriptionAttribute(value: String, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 28u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeDescriptionAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 28u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - StringSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Description attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: String? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getString(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(StringSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(StringSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readInactiveTextAttribute(): String? { - val ATTRIBUTE_ID: UInt = 46u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Inactivetext attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: String? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getString(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeInactiveTextAttribute(value: String, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 46u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeInactiveTextAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 46u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - StringSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Inactivetext attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: String? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getString(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(StringSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(StringSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readOutOfServiceAttribute(): Boolean { - val ATTRIBUTE_ID: UInt = 81u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Outofservice attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Boolean = tlvReader.getBoolean(AnonymousTag) - - return decodedValue - } - - suspend fun writeOutOfServiceAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 81u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeOutOfServiceAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 81u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - BooleanSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Outofservice attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Boolean = tlvReader.getBoolean(AnonymousTag) - - emit(BooleanSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(BooleanSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readPolarityAttribute(): UByte? { - val ATTRIBUTE_ID: UInt = 84u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Polarity attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribePolarityAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 84u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UByteSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Polarity attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readPresentValueAttribute(): Boolean { - val ATTRIBUTE_ID: UInt = 85u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Presentvalue attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Boolean = tlvReader.getBoolean(AnonymousTag) - - return decodedValue - } - - suspend fun writePresentValueAttribute(value: Boolean, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 85u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribePresentValueAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 85u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - BooleanSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Presentvalue attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Boolean = tlvReader.getBoolean(AnonymousTag) - - emit(BooleanSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(BooleanSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readReliabilityAttribute(): UByte? { - val ATTRIBUTE_ID: UInt = 103u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Reliability attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeReliabilityAttribute(value: UByte, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 103u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeReliabilityAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 103u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UByteSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Reliability attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readStatusFlagsAttribute(): UByte { - val ATTRIBUTE_ID: UInt = 111u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Statusflags attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) - - return decodedValue - } - - suspend fun subscribeStatusFlagsAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 111u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UByteSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Statusflags attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) - - emit(UByteSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(UByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readApplicationTypeAttribute(): UInt? { - val ATTRIBUTE_ID: UInt = 256u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Applicationtype attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUInt(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeApplicationTypeAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 256u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UIntSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Applicationtype attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUInt(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UIntSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UIntSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { - val ATTRIBUTE_ID: UInt = 65528u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return GeneratedCommandListAttribute(decodedValue) - } - - suspend fun subscribeGeneratedCommandListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65528u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - GeneratedCommandListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Generatedcommandlist attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { - val ATTRIBUTE_ID: UInt = 65529u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return AcceptedCommandListAttribute(decodedValue) - } - - suspend fun subscribeAcceptedCommandListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65529u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - AcceptedCommandListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acceptedcommandlist attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readEventListAttribute(): EventListAttribute { - val ATTRIBUTE_ID: UInt = 65530u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Eventlist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return EventListAttribute(decodedValue) - } - - suspend fun subscribeEventListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65530u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - EventListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(EventListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(EventListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAttributeListAttribute(): AttributeListAttribute { - val ATTRIBUTE_ID: UInt = 65531u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Attributelist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return AttributeListAttribute(decodedValue) - } - - suspend fun subscribeAttributeListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65531u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - AttributeListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readFeatureMapAttribute(): UInt { - val ATTRIBUTE_ID: UInt = 65532u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Featuremap attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) - - return decodedValue - } - - suspend fun subscribeFeatureMapAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65532u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UIntSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) - - emit(UIntSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(UIntSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readClusterRevisionAttribute(): UShort { - val ATTRIBUTE_ID: UInt = 65533u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Clusterrevision attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) - - return decodedValue - } - - suspend fun subscribeClusterRevisionAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65533u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Clusterrevision attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) - - emit(UShortSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - companion object { - private val logger = Logger.getLogger(BinaryInputBasicCluster::class.java.name) - const val CLUSTER_ID: UInt = 15u - } -} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/ElectricalMeasurementCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/ElectricalMeasurementCluster.kt deleted file mode 100644 index 7c564d94f7738c..00000000000000 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/ElectricalMeasurementCluster.kt +++ /dev/null @@ -1,12934 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package matter.controller.cluster.clusters - -import java.time.Duration -import java.util.logging.Level -import java.util.logging.Logger -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.transform -import matter.controller.ByteSubscriptionState -import matter.controller.IntSubscriptionState -import matter.controller.InvokeRequest -import matter.controller.InvokeResponse -import matter.controller.MatterController -import matter.controller.ReadData -import matter.controller.ReadRequest -import matter.controller.ShortSubscriptionState -import matter.controller.SubscribeRequest -import matter.controller.SubscriptionState -import matter.controller.UByteSubscriptionState -import matter.controller.UIntSubscriptionState -import matter.controller.UShortSubscriptionState -import matter.controller.WriteRequest -import matter.controller.WriteRequests -import matter.controller.WriteResponse -import matter.controller.cluster.structs.* -import matter.controller.model.AttributePath -import matter.controller.model.CommandPath -import matter.tlv.AnonymousTag -import matter.tlv.ContextSpecificTag -import matter.tlv.TlvReader -import matter.tlv.TlvWriter - -class ElectricalMeasurementCluster( - private val controller: MatterController, - private val endpointId: UShort, -) { - class GeneratedCommandListAttribute(val value: List) - - sealed class GeneratedCommandListAttributeSubscriptionState { - data class Success(val value: List) : GeneratedCommandListAttributeSubscriptionState() - - data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() - - object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() - } - - class AcceptedCommandListAttribute(val value: List) - - sealed class AcceptedCommandListAttributeSubscriptionState { - data class Success(val value: List) : AcceptedCommandListAttributeSubscriptionState() - - data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() - - object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() - } - - class EventListAttribute(val value: List) - - sealed class EventListAttributeSubscriptionState { - data class Success(val value: List) : EventListAttributeSubscriptionState() - - data class Error(val exception: Exception) : EventListAttributeSubscriptionState() - - object SubscriptionEstablished : EventListAttributeSubscriptionState() - } - - class AttributeListAttribute(val value: List) - - sealed class AttributeListAttributeSubscriptionState { - data class Success(val value: List) : AttributeListAttributeSubscriptionState() - - data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() - - object SubscriptionEstablished : AttributeListAttributeSubscriptionState() - } - - suspend fun getProfileInfoCommand(timedInvokeTimeout: Duration? = null) { - val commandId: UInt = 0u - - val tlvWriter = TlvWriter() - tlvWriter.startStructure(AnonymousTag) - tlvWriter.endStructure() - - val request: InvokeRequest = - InvokeRequest( - CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), - tlvPayload = tlvWriter.getEncoded(), - timedRequest = timedInvokeTimeout, - ) - - val response: InvokeResponse = controller.invoke(request) - logger.log(Level.FINE, "Invoke command succeeded: ${response}") - } - - suspend fun getMeasurementProfileCommand( - attributeId: UShort, - startTime: UInt, - numberOfIntervals: UByte, - timedInvokeTimeout: Duration? = null, - ) { - val commandId: UInt = 1u - - val tlvWriter = TlvWriter() - tlvWriter.startStructure(AnonymousTag) - - val TAG_ATTRIBUTE_ID_REQ: Int = 0 - tlvWriter.put(ContextSpecificTag(TAG_ATTRIBUTE_ID_REQ), attributeId) - - val TAG_START_TIME_REQ: Int = 1 - tlvWriter.put(ContextSpecificTag(TAG_START_TIME_REQ), startTime) - - val TAG_NUMBER_OF_INTERVALS_REQ: Int = 2 - tlvWriter.put(ContextSpecificTag(TAG_NUMBER_OF_INTERVALS_REQ), numberOfIntervals) - tlvWriter.endStructure() - - val request: InvokeRequest = - InvokeRequest( - CommandPath(endpointId, clusterId = CLUSTER_ID, commandId), - tlvPayload = tlvWriter.getEncoded(), - timedRequest = timedInvokeTimeout, - ) - - val response: InvokeResponse = controller.invoke(request) - logger.log(Level.FINE, "Invoke command succeeded: ${response}") - } - - suspend fun readMeasurementTypeAttribute(): UInt? { - val ATTRIBUTE_ID: UInt = 0u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Measurementtype attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUInt(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeMeasurementTypeAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 0u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UIntSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Measurementtype attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUInt(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UIntSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UIntSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDcVoltageAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 256u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Dcvoltage attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeDcVoltageAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 256u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Dcvoltage attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDcVoltageMinAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 257u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Dcvoltagemin attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeDcVoltageMinAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 257u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Dcvoltagemin attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDcVoltageMaxAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 258u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Dcvoltagemax attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeDcVoltageMaxAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 258u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Dcvoltagemax attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDcCurrentAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 259u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Dccurrent attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeDcCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 259u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Dccurrent attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDcCurrentMinAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 260u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Dccurrentmin attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeDcCurrentMinAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 260u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Dccurrentmin attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDcCurrentMaxAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 261u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Dccurrentmax attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeDcCurrentMaxAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 261u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Dccurrentmax attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDcPowerAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 262u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Dcpower attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeDcPowerAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 262u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Dcpower attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDcPowerMinAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 263u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Dcpowermin attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeDcPowerMinAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 263u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Dcpowermin attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDcPowerMaxAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 264u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Dcpowermax attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeDcPowerMaxAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 264u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Dcpowermax attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDcVoltageMultiplierAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 512u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Dcvoltagemultiplier attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeDcVoltageMultiplierAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 512u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Dcvoltagemultiplier attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDcVoltageDivisorAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 513u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Dcvoltagedivisor attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeDcVoltageDivisorAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 513u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Dcvoltagedivisor attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDcCurrentMultiplierAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 514u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Dccurrentmultiplier attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeDcCurrentMultiplierAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 514u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Dccurrentmultiplier attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDcCurrentDivisorAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 515u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Dccurrentdivisor attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeDcCurrentDivisorAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 515u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Dccurrentdivisor attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDcPowerMultiplierAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 516u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Dcpowermultiplier attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeDcPowerMultiplierAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 516u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Dcpowermultiplier attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readDcPowerDivisorAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 517u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Dcpowerdivisor attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeDcPowerDivisorAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 517u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Dcpowerdivisor attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcFrequencyAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 768u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acfrequency attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAcFrequencyAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 768u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Acfrequency attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcFrequencyMinAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 769u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acfrequencymin attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAcFrequencyMinAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 769u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acfrequencymin attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcFrequencyMaxAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 770u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acfrequencymax attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAcFrequencyMaxAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 770u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acfrequencymax attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readNeutralCurrentAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 771u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Neutralcurrent attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeNeutralCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 771u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Neutralcurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readTotalActivePowerAttribute(): Int? { - val ATTRIBUTE_ID: UInt = 772u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Totalactivepower attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Int? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getInt(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeTotalActivePowerAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 772u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - IntSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Totalactivepower attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Int? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getInt(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(IntSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(IntSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readTotalReactivePowerAttribute(): Int? { - val ATTRIBUTE_ID: UInt = 773u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Totalreactivepower attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Int? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getInt(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeTotalReactivePowerAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 773u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - IntSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Totalreactivepower attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Int? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getInt(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(IntSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(IntSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readTotalApparentPowerAttribute(): UInt? { - val ATTRIBUTE_ID: UInt = 774u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Totalapparentpower attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUInt(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeTotalApparentPowerAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 774u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UIntSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Totalapparentpower attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUInt(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UIntSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UIntSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readMeasured1stHarmonicCurrentAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 775u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Measured1stharmoniccurrent attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeMeasured1stHarmonicCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 775u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Measured1stharmoniccurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readMeasured3rdHarmonicCurrentAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 776u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Measured3rdharmoniccurrent attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeMeasured3rdHarmonicCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 776u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Measured3rdharmoniccurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readMeasured5thHarmonicCurrentAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 777u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Measured5thharmoniccurrent attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeMeasured5thHarmonicCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 777u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Measured5thharmoniccurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readMeasured7thHarmonicCurrentAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 778u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Measured7thharmoniccurrent attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeMeasured7thHarmonicCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 778u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Measured7thharmoniccurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readMeasured9thHarmonicCurrentAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 779u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Measured9thharmoniccurrent attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeMeasured9thHarmonicCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 779u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Measured9thharmoniccurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readMeasured11thHarmonicCurrentAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 780u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Measured11thharmoniccurrent attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeMeasured11thHarmonicCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 780u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Measured11thharmoniccurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readMeasuredPhase1stHarmonicCurrentAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 781u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Measuredphase1stharmoniccurrent attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeMeasuredPhase1stHarmonicCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 781u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Measuredphase1stharmoniccurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readMeasuredPhase3rdHarmonicCurrentAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 782u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Measuredphase3rdharmoniccurrent attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeMeasuredPhase3rdHarmonicCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 782u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Measuredphase3rdharmoniccurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readMeasuredPhase5thHarmonicCurrentAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 783u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Measuredphase5thharmoniccurrent attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeMeasuredPhase5thHarmonicCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 783u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Measuredphase5thharmoniccurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readMeasuredPhase7thHarmonicCurrentAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 784u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Measuredphase7thharmoniccurrent attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeMeasuredPhase7thHarmonicCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 784u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Measuredphase7thharmoniccurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readMeasuredPhase9thHarmonicCurrentAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 785u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Measuredphase9thharmoniccurrent attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeMeasuredPhase9thHarmonicCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 785u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Measuredphase9thharmoniccurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readMeasuredPhase11thHarmonicCurrentAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 786u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Measuredphase11thharmoniccurrent attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeMeasuredPhase11thHarmonicCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 786u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Measuredphase11thharmoniccurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcFrequencyMultiplierAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1024u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acfrequencymultiplier attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAcFrequencyMultiplierAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1024u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acfrequencymultiplier attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcFrequencyDivisorAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1025u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acfrequencydivisor attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAcFrequencyDivisorAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1025u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acfrequencydivisor attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readPowerMultiplierAttribute(): UInt? { - val ATTRIBUTE_ID: UInt = 1026u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Powermultiplier attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUInt(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribePowerMultiplierAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1026u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UIntSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Powermultiplier attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUInt(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UIntSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UIntSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readPowerDivisorAttribute(): UInt? { - val ATTRIBUTE_ID: UInt = 1027u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Powerdivisor attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUInt(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribePowerDivisorAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1027u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UIntSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Powerdivisor attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUInt(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UIntSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UIntSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readHarmonicCurrentMultiplierAttribute(): Byte? { - val ATTRIBUTE_ID: UInt = 1028u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Harmoniccurrentmultiplier attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Byte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getByte(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeHarmonicCurrentMultiplierAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1028u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ByteSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Harmoniccurrentmultiplier attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Byte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getByte(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ByteSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readPhaseHarmonicCurrentMultiplierAttribute(): Byte? { - val ATTRIBUTE_ID: UInt = 1029u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Phaseharmoniccurrentmultiplier attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Byte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getByte(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribePhaseHarmonicCurrentMultiplierAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1029u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ByteSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Phaseharmoniccurrentmultiplier attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Byte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getByte(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ByteSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readInstantaneousVoltageAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 1280u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Instantaneousvoltage attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeInstantaneousVoltageAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1280u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Instantaneousvoltage attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readInstantaneousLineCurrentAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1281u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Instantaneouslinecurrent attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeInstantaneousLineCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1281u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Instantaneouslinecurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readInstantaneousActiveCurrentAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 1282u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Instantaneousactivecurrent attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeInstantaneousActiveCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1282u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Instantaneousactivecurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readInstantaneousReactiveCurrentAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 1283u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Instantaneousreactivecurrent attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeInstantaneousReactiveCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1283u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Instantaneousreactivecurrent attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readInstantaneousPowerAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 1284u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Instantaneouspower attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeInstantaneousPowerAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1284u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Instantaneouspower attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltageAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1285u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltage attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsVoltageAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1285u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Rmsvoltage attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltageMinAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1286u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltagemin attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsVoltageMinAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1286u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Rmsvoltagemin attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltageMaxAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1287u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltagemax attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsVoltageMaxAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1287u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Rmsvoltagemax attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsCurrentAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1288u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmscurrent attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsCurrentAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1288u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Rmscurrent attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsCurrentMinAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1289u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmscurrentmin attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsCurrentMinAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1289u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Rmscurrentmin attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsCurrentMaxAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1290u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmscurrentmax attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsCurrentMaxAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1290u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Rmscurrentmax attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readActivePowerAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 1291u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Activepower attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeActivePowerAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1291u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Activepower attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readActivePowerMinAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 1292u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Activepowermin attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeActivePowerMinAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1292u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Activepowermin attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readActivePowerMaxAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 1293u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Activepowermax attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeActivePowerMaxAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1293u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Activepowermax attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readReactivePowerAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 1294u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Reactivepower attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeReactivePowerAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1294u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Reactivepower attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readApparentPowerAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1295u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Apparentpower attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeApparentPowerAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1295u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Apparentpower attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readPowerFactorAttribute(): Byte? { - val ATTRIBUTE_ID: UInt = 1296u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Powerfactor attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Byte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getByte(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribePowerFactorAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1296u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ByteSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Powerfactor attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Byte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getByte(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ByteSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAverageRmsVoltageMeasurementPeriodAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1297u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Averagermsvoltagemeasurementperiod attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeAverageRmsVoltageMeasurementPeriodAttribute( - value: UShort, - timedWriteTimeout: Duration? = null, - ) { - val ATTRIBUTE_ID: UInt = 1297u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeAverageRmsVoltageMeasurementPeriodAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1297u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Averagermsvoltagemeasurementperiod attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAverageRmsUnderVoltageCounterAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1299u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Averagermsundervoltagecounter attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeAverageRmsUnderVoltageCounterAttribute( - value: UShort, - timedWriteTimeout: Duration? = null, - ) { - val ATTRIBUTE_ID: UInt = 1299u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeAverageRmsUnderVoltageCounterAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1299u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Averagermsundervoltagecounter attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsExtremeOverVoltagePeriodAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1300u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsextremeovervoltageperiod attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeRmsExtremeOverVoltagePeriodAttribute( - value: UShort, - timedWriteTimeout: Duration? = null, - ) { - val ATTRIBUTE_ID: UInt = 1300u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeRmsExtremeOverVoltagePeriodAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1300u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsextremeovervoltageperiod attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsExtremeUnderVoltagePeriodAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1301u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsextremeundervoltageperiod attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeRmsExtremeUnderVoltagePeriodAttribute( - value: UShort, - timedWriteTimeout: Duration? = null, - ) { - val ATTRIBUTE_ID: UInt = 1301u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeRmsExtremeUnderVoltagePeriodAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1301u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsextremeundervoltageperiod attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltageSagPeriodAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1302u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltagesagperiod attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeRmsVoltageSagPeriodAttribute( - value: UShort, - timedWriteTimeout: Duration? = null, - ) { - val ATTRIBUTE_ID: UInt = 1302u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeRmsVoltageSagPeriodAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1302u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsvoltagesagperiod attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltageSwellPeriodAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1303u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltageswellperiod attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeRmsVoltageSwellPeriodAttribute( - value: UShort, - timedWriteTimeout: Duration? = null, - ) { - val ATTRIBUTE_ID: UInt = 1303u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeRmsVoltageSwellPeriodAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1303u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsvoltageswellperiod attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcVoltageMultiplierAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1536u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acvoltagemultiplier attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAcVoltageMultiplierAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1536u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acvoltagemultiplier attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcVoltageDivisorAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1537u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acvoltagedivisor attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAcVoltageDivisorAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1537u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acvoltagedivisor attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcCurrentMultiplierAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1538u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Accurrentmultiplier attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAcCurrentMultiplierAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1538u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Accurrentmultiplier attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcCurrentDivisorAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1539u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Accurrentdivisor attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAcCurrentDivisorAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1539u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Accurrentdivisor attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcPowerMultiplierAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1540u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acpowermultiplier attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAcPowerMultiplierAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1540u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acpowermultiplier attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcPowerDivisorAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 1541u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acpowerdivisor attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAcPowerDivisorAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1541u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acpowerdivisor attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readOverloadAlarmsMaskAttribute(): UByte? { - val ATTRIBUTE_ID: UInt = 1792u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Overloadalarmsmask attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeOverloadAlarmsMaskAttribute(value: UByte, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 1792u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeOverloadAlarmsMaskAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1792u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UByteSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Overloadalarmsmask attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUByte(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UByteSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readVoltageOverloadAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 1793u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Voltageoverload attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeVoltageOverloadAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1793u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Voltageoverload attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readCurrentOverloadAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 1794u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Currentoverload attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeCurrentOverloadAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 1794u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Currentoverload attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcOverloadAlarmsMaskAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2048u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acoverloadalarmsmask attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun writeAcOverloadAlarmsMaskAttribute( - value: UShort, - timedWriteTimeout: Duration? = null, - ) { - val ATTRIBUTE_ID: UInt = 2048u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeAcOverloadAlarmsMaskAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2048u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acoverloadalarmsmask attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcVoltageOverloadAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2049u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acvoltageoverload attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAcVoltageOverloadAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2049u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acvoltageoverload attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcCurrentOverloadAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2050u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Accurrentoverload attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAcCurrentOverloadAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2050u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Accurrentoverload attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcActivePowerOverloadAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2051u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acactivepoweroverload attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAcActivePowerOverloadAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2051u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acactivepoweroverload attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcReactivePowerOverloadAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2052u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acreactivepoweroverload attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAcReactivePowerOverloadAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2052u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acreactivepoweroverload attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAverageRmsOverVoltageAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2053u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Averagermsovervoltage attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAverageRmsOverVoltageAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2053u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Averagermsovervoltage attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAverageRmsUnderVoltageAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2054u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Averagermsundervoltage attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAverageRmsUnderVoltageAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2054u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Averagermsundervoltage attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsExtremeOverVoltageAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2055u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsextremeovervoltage attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsExtremeOverVoltageAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2055u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsextremeovervoltage attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsExtremeUnderVoltageAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2056u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsextremeundervoltage attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsExtremeUnderVoltageAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2056u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsextremeundervoltage attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltageSagAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2057u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltagesag attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsVoltageSagAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2057u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Rmsvoltagesag attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltageSwellAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2058u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltageswell attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsVoltageSwellAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2058u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsvoltageswell attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readLineCurrentPhaseBAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2305u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Linecurrentphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeLineCurrentPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2305u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Linecurrentphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readActiveCurrentPhaseBAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2306u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Activecurrentphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeActiveCurrentPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2306u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Activecurrentphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readReactiveCurrentPhaseBAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2307u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Reactivecurrentphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeReactiveCurrentPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2307u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Reactivecurrentphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltagePhaseBAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2309u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltagephaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsVoltagePhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2309u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsvoltagephaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltageMinPhaseBAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2310u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltageminphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsVoltageMinPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2310u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsvoltageminphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltageMaxPhaseBAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2311u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltagemaxphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsVoltageMaxPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2311u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsvoltagemaxphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsCurrentPhaseBAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2312u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmscurrentphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsCurrentPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2312u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmscurrentphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsCurrentMinPhaseBAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2313u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmscurrentminphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsCurrentMinPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2313u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmscurrentminphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsCurrentMaxPhaseBAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2314u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmscurrentmaxphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsCurrentMaxPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2314u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmscurrentmaxphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readActivePowerPhaseBAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2315u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Activepowerphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeActivePowerPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2315u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Activepowerphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readActivePowerMinPhaseBAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2316u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Activepowerminphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeActivePowerMinPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2316u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Activepowerminphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readActivePowerMaxPhaseBAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2317u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Activepowermaxphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeActivePowerMaxPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2317u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Activepowermaxphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readReactivePowerPhaseBAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2318u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Reactivepowerphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeReactivePowerPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2318u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Reactivepowerphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readApparentPowerPhaseBAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2319u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Apparentpowerphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeApparentPowerPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2319u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Apparentpowerphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readPowerFactorPhaseBAttribute(): Byte? { - val ATTRIBUTE_ID: UInt = 2320u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Powerfactorphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Byte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getByte(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribePowerFactorPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2320u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ByteSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Powerfactorphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Byte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getByte(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ByteSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAverageRmsVoltageMeasurementPeriodPhaseBAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2321u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Averagermsvoltagemeasurementperiodphaseb attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAverageRmsVoltageMeasurementPeriodPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2321u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Averagermsvoltagemeasurementperiodphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAverageRmsOverVoltageCounterPhaseBAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2322u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Averagermsovervoltagecounterphaseb attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAverageRmsOverVoltageCounterPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2322u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Averagermsovervoltagecounterphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAverageRmsUnderVoltageCounterPhaseBAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2323u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Averagermsundervoltagecounterphaseb attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAverageRmsUnderVoltageCounterPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2323u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Averagermsundervoltagecounterphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsExtremeOverVoltagePeriodPhaseBAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2324u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Rmsextremeovervoltageperiodphaseb attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsExtremeOverVoltagePeriodPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2324u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsextremeovervoltageperiodphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsExtremeUnderVoltagePeriodPhaseBAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2325u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Rmsextremeundervoltageperiodphaseb attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsExtremeUnderVoltagePeriodPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2325u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsextremeundervoltageperiodphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltageSagPeriodPhaseBAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2326u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltagesagperiodphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsVoltageSagPeriodPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2326u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsvoltagesagperiodphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltageSwellPeriodPhaseBAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2327u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltageswellperiodphaseb attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsVoltageSwellPeriodPhaseBAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2327u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsvoltageswellperiodphaseb attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readLineCurrentPhaseCAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2561u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Linecurrentphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeLineCurrentPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2561u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Linecurrentphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readActiveCurrentPhaseCAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2562u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Activecurrentphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeActiveCurrentPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2562u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Activecurrentphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readReactiveCurrentPhaseCAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2563u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Reactivecurrentphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeReactiveCurrentPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2563u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Reactivecurrentphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltagePhaseCAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2565u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltagephasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsVoltagePhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2565u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsvoltagephasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltageMinPhaseCAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2566u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltageminphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsVoltageMinPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2566u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsvoltageminphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltageMaxPhaseCAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2567u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltagemaxphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsVoltageMaxPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2567u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsvoltagemaxphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsCurrentPhaseCAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2568u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmscurrentphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsCurrentPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2568u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmscurrentphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsCurrentMinPhaseCAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2569u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmscurrentminphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsCurrentMinPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2569u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmscurrentminphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsCurrentMaxPhaseCAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2570u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmscurrentmaxphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsCurrentMaxPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2570u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmscurrentmaxphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readActivePowerPhaseCAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2571u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Activepowerphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeActivePowerPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2571u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Activepowerphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readActivePowerMinPhaseCAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2572u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Activepowerminphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeActivePowerMinPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2572u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Activepowerminphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readActivePowerMaxPhaseCAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2573u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Activepowermaxphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeActivePowerMaxPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2573u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Activepowermaxphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readReactivePowerPhaseCAttribute(): Short? { - val ATTRIBUTE_ID: UInt = 2574u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Reactivepowerphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeReactivePowerPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2574u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Reactivepowerphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Short? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readApparentPowerPhaseCAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2575u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Apparentpowerphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeApparentPowerPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2575u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Apparentpowerphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readPowerFactorPhaseCAttribute(): Byte? { - val ATTRIBUTE_ID: UInt = 2576u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Powerfactorphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Byte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getByte(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribePowerFactorPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2576u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - ByteSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Powerfactorphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: Byte? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getByte(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(ByteSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(ByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAverageRmsVoltageMeasurementPeriodPhaseCAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2577u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Averagermsvoltagemeasurementperiodphasec attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAverageRmsVoltageMeasurementPeriodPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2577u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Averagermsvoltagemeasurementperiodphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAverageRmsOverVoltageCounterPhaseCAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2578u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Averagermsovervoltagecounterphasec attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAverageRmsOverVoltageCounterPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2578u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Averagermsovervoltagecounterphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAverageRmsUnderVoltageCounterPhaseCAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2579u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Averagermsundervoltagecounterphasec attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeAverageRmsUnderVoltageCounterPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2579u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Averagermsundervoltagecounterphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsExtremeOverVoltagePeriodPhaseCAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2580u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Rmsextremeovervoltageperiodphasec attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsExtremeOverVoltagePeriodPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2580u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsextremeovervoltageperiodphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsExtremeUnderVoltagePeriodPhaseCAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2581u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { - "Rmsextremeundervoltageperiodphasec attribute not found in response" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsExtremeUnderVoltagePeriodPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2581u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsextremeundervoltageperiodphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltageSagPeriodPhaseCAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2582u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltagesagperiodphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsVoltageSagPeriodPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2582u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsvoltagesagperiodphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readRmsVoltageSwellPeriodPhaseCAttribute(): UShort? { - val ATTRIBUTE_ID: UInt = 2583u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Rmsvoltageswellperiodphasec attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - return decodedValue - } - - suspend fun subscribeRmsVoltageSwellPeriodPhaseCAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 2583u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Rmsvoltageswellperiodphasec attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort? = - if (tlvReader.isNextTag(AnonymousTag)) { - tlvReader.getUShort(AnonymousTag) - } else { - null - } - - decodedValue?.let { emit(UShortSubscriptionState.Success(it)) } - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { - val ATTRIBUTE_ID: UInt = 65528u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return GeneratedCommandListAttribute(decodedValue) - } - - suspend fun subscribeGeneratedCommandListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65528u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - GeneratedCommandListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Generatedcommandlist attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { - val ATTRIBUTE_ID: UInt = 65529u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return AcceptedCommandListAttribute(decodedValue) - } - - suspend fun subscribeAcceptedCommandListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65529u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - AcceptedCommandListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acceptedcommandlist attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readEventListAttribute(): EventListAttribute { - val ATTRIBUTE_ID: UInt = 65530u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Eventlist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return EventListAttribute(decodedValue) - } - - suspend fun subscribeEventListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65530u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - EventListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(EventListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(EventListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAttributeListAttribute(): AttributeListAttribute { - val ATTRIBUTE_ID: UInt = 65531u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Attributelist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return AttributeListAttribute(decodedValue) - } - - suspend fun subscribeAttributeListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65531u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - AttributeListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readFeatureMapAttribute(): UInt { - val ATTRIBUTE_ID: UInt = 65532u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Featuremap attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) - - return decodedValue - } - - suspend fun subscribeFeatureMapAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65532u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UIntSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) - - emit(UIntSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(UIntSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readClusterRevisionAttribute(): UShort { - val ATTRIBUTE_ID: UInt = 65533u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Clusterrevision attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) - - return decodedValue - } - - suspend fun subscribeClusterRevisionAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65533u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Clusterrevision attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) - - emit(UShortSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - companion object { - private val logger = Logger.getLogger(ElectricalMeasurementCluster::class.java.name) - const val CLUSTER_ID: UInt = 2820u - } -} diff --git a/src/controller/java/generated/java/matter/controller/cluster/clusters/OnOffSwitchConfigurationCluster.kt b/src/controller/java/generated/java/matter/controller/cluster/clusters/OnOffSwitchConfigurationCluster.kt deleted file mode 100644 index 88a03128e9f596..00000000000000 --- a/src/controller/java/generated/java/matter/controller/cluster/clusters/OnOffSwitchConfigurationCluster.kt +++ /dev/null @@ -1,840 +0,0 @@ -/* - * - * Copyright (c) 2023 Project CHIP Authors - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package matter.controller.cluster.clusters - -import java.time.Duration -import java.util.logging.Level -import java.util.logging.Logger -import kotlinx.coroutines.flow.Flow -import kotlinx.coroutines.flow.transform -import matter.controller.MatterController -import matter.controller.ReadData -import matter.controller.ReadRequest -import matter.controller.SubscribeRequest -import matter.controller.SubscriptionState -import matter.controller.UByteSubscriptionState -import matter.controller.UIntSubscriptionState -import matter.controller.UShortSubscriptionState -import matter.controller.WriteRequest -import matter.controller.WriteRequests -import matter.controller.WriteResponse -import matter.controller.cluster.structs.* -import matter.controller.model.AttributePath -import matter.tlv.AnonymousTag -import matter.tlv.TlvReader -import matter.tlv.TlvWriter - -class OnOffSwitchConfigurationCluster( - private val controller: MatterController, - private val endpointId: UShort, -) { - class GeneratedCommandListAttribute(val value: List) - - sealed class GeneratedCommandListAttributeSubscriptionState { - data class Success(val value: List) : GeneratedCommandListAttributeSubscriptionState() - - data class Error(val exception: Exception) : GeneratedCommandListAttributeSubscriptionState() - - object SubscriptionEstablished : GeneratedCommandListAttributeSubscriptionState() - } - - class AcceptedCommandListAttribute(val value: List) - - sealed class AcceptedCommandListAttributeSubscriptionState { - data class Success(val value: List) : AcceptedCommandListAttributeSubscriptionState() - - data class Error(val exception: Exception) : AcceptedCommandListAttributeSubscriptionState() - - object SubscriptionEstablished : AcceptedCommandListAttributeSubscriptionState() - } - - class EventListAttribute(val value: List) - - sealed class EventListAttributeSubscriptionState { - data class Success(val value: List) : EventListAttributeSubscriptionState() - - data class Error(val exception: Exception) : EventListAttributeSubscriptionState() - - object SubscriptionEstablished : EventListAttributeSubscriptionState() - } - - class AttributeListAttribute(val value: List) - - sealed class AttributeListAttributeSubscriptionState { - data class Success(val value: List) : AttributeListAttributeSubscriptionState() - - data class Error(val exception: Exception) : AttributeListAttributeSubscriptionState() - - object SubscriptionEstablished : AttributeListAttributeSubscriptionState() - } - - suspend fun readSwitchTypeAttribute(): UByte { - val ATTRIBUTE_ID: UInt = 0u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Switchtype attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) - - return decodedValue - } - - suspend fun subscribeSwitchTypeAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 0u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UByteSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Switchtype attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) - - emit(UByteSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(UByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readSwitchActionsAttribute(): UByte { - val ATTRIBUTE_ID: UInt = 16u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Switchactions attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) - - return decodedValue - } - - suspend fun writeSwitchActionsAttribute(value: UByte, timedWriteTimeout: Duration? = null) { - val ATTRIBUTE_ID: UInt = 16u - - val tlvWriter = TlvWriter() - tlvWriter.put(AnonymousTag, value) - - val writeRequests: WriteRequests = - WriteRequests( - requests = - listOf( - WriteRequest( - attributePath = - AttributePath(endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID), - tlvPayload = tlvWriter.getEncoded(), - ) - ), - timedRequest = timedWriteTimeout, - ) - - val response: WriteResponse = controller.write(writeRequests) - - when (response) { - is WriteResponse.Success -> { - logger.log(Level.FINE, "Write command succeeded") - } - is WriteResponse.PartialWriteFailure -> { - val aggregatedErrorMessage = - response.failures.joinToString("\n") { failure -> - "Error at ${failure.attributePath}: ${failure.ex.message}" - } - - response.failures.forEach { failure -> - logger.log(Level.WARNING, "Error at ${failure.attributePath}: ${failure.ex.message}") - } - - throw IllegalStateException("Write command failed with errors: \n$aggregatedErrorMessage") - } - } - } - - suspend fun subscribeSwitchActionsAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 16u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UByteSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Switchactions attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UByte = tlvReader.getUByte(AnonymousTag) - - emit(UByteSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(UByteSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readGeneratedCommandListAttribute(): GeneratedCommandListAttribute { - val ATTRIBUTE_ID: UInt = 65528u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Generatedcommandlist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return GeneratedCommandListAttribute(decodedValue) - } - - suspend fun subscribeGeneratedCommandListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65528u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - GeneratedCommandListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Generatedcommandlist attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(GeneratedCommandListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(GeneratedCommandListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAcceptedCommandListAttribute(): AcceptedCommandListAttribute { - val ATTRIBUTE_ID: UInt = 65529u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Acceptedcommandlist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return AcceptedCommandListAttribute(decodedValue) - } - - suspend fun subscribeAcceptedCommandListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65529u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - AcceptedCommandListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Acceptedcommandlist attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(AcceptedCommandListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(AcceptedCommandListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readEventListAttribute(): EventListAttribute { - val ATTRIBUTE_ID: UInt = 65530u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Eventlist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return EventListAttribute(decodedValue) - } - - suspend fun subscribeEventListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65530u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - EventListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Eventlist attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(EventListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(EventListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readAttributeListAttribute(): AttributeListAttribute { - val ATTRIBUTE_ID: UInt = 65531u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Attributelist attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - return AttributeListAttribute(decodedValue) - } - - suspend fun subscribeAttributeListAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65531u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - AttributeListAttributeSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Attributelist attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: List = - buildList { - tlvReader.enterArray(AnonymousTag) - while (!tlvReader.isEndOfContainer()) { - add(tlvReader.getUInt(AnonymousTag)) - } - tlvReader.exitContainer() - } - - emit(AttributeListAttributeSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(AttributeListAttributeSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readFeatureMapAttribute(): UInt { - val ATTRIBUTE_ID: UInt = 65532u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Featuremap attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) - - return decodedValue - } - - suspend fun subscribeFeatureMapAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65532u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UIntSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { "Featuremap attribute not found in Node State update" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UInt = tlvReader.getUInt(AnonymousTag) - - emit(UIntSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(UIntSubscriptionState.SubscriptionEstablished) - } - } - } - } - - suspend fun readClusterRevisionAttribute(): UShort { - val ATTRIBUTE_ID: UInt = 65533u - - val attributePath = - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - - val readRequest = ReadRequest(eventPaths = emptyList(), attributePaths = listOf(attributePath)) - - val response = controller.read(readRequest) - - if (response.successes.isEmpty()) { - logger.log(Level.WARNING, "Read command failed") - throw IllegalStateException("Read command failed with failures: ${response.failures}") - } - - logger.log(Level.FINE, "Read command succeeded") - - val attributeData = - response.successes.filterIsInstance().firstOrNull { - it.path.attributeId == ATTRIBUTE_ID - } - - requireNotNull(attributeData) { "Clusterrevision attribute not found in response" } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) - - return decodedValue - } - - suspend fun subscribeClusterRevisionAttribute( - minInterval: Int, - maxInterval: Int, - ): Flow { - val ATTRIBUTE_ID: UInt = 65533u - val attributePaths = - listOf( - AttributePath(endpointId = endpointId, clusterId = CLUSTER_ID, attributeId = ATTRIBUTE_ID) - ) - - val subscribeRequest: SubscribeRequest = - SubscribeRequest( - eventPaths = emptyList(), - attributePaths = attributePaths, - minInterval = Duration.ofSeconds(minInterval.toLong()), - maxInterval = Duration.ofSeconds(maxInterval.toLong()), - ) - - return controller.subscribe(subscribeRequest).transform { subscriptionState -> - when (subscriptionState) { - is SubscriptionState.SubscriptionErrorNotification -> { - emit( - UShortSubscriptionState.Error( - Exception( - "Subscription terminated with error code: ${subscriptionState.terminationCause}" - ) - ) - ) - } - is SubscriptionState.NodeStateUpdate -> { - val attributeData = - subscriptionState.updateState.successes - .filterIsInstance() - .firstOrNull { it.path.attributeId == ATTRIBUTE_ID } - - requireNotNull(attributeData) { - "Clusterrevision attribute not found in Node State update" - } - - // Decode the TLV data into the appropriate type - val tlvReader = TlvReader(attributeData.data) - val decodedValue: UShort = tlvReader.getUShort(AnonymousTag) - - emit(UShortSubscriptionState.Success(decodedValue)) - } - SubscriptionState.SubscriptionEstablished -> { - emit(UShortSubscriptionState.SubscriptionEstablished) - } - } - } - } - - companion object { - private val logger = Logger.getLogger(OnOffSwitchConfigurationCluster::class.java.name) - const val CLUSTER_ID: UInt = 7u - } -} diff --git a/src/controller/java/generated/java/matter/controller/cluster/files.gni b/src/controller/java/generated/java/matter/controller/cluster/files.gni index 1f287a13ae0ff2..d1a3d9681b21bf 100644 --- a/src/controller/java/generated/java/matter/controller/cluster/files.gni +++ b/src/controller/java/generated/java/matter/controller/cluster/files.gni @@ -259,9 +259,7 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ApplicationLauncherCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/AudioOutputCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/BallastConfigurationCluster.kt", - "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/BarrierControlCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/BasicInformationCluster.kt", - "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/BinaryInputBasicCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/BindingCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/BooleanStateCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/BooleanStateConfigurationCluster.kt", @@ -284,7 +282,6 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/DoorLockCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/EcosystemInformationCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ElectricalEnergyMeasurementCluster.kt", - "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ElectricalMeasurementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/ElectricalPowerMeasurementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/EnergyEvseModeCluster.kt", @@ -320,7 +317,6 @@ matter_clusters_sources = [ "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/NitrogenDioxideConcentrationMeasurementCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/OccupancySensingCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/OnOffCluster.kt", - "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/OnOffSwitchConfigurationCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/OperationalCredentialsCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/OperationalStateCluster.kt", "${chip_root}/src/controller/java/generated/java/matter/controller/cluster/clusters/OtaSoftwareUpdateProviderCluster.kt", diff --git a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp index 771d026771d39d..fbbb5be261737f 100644 --- a/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPAttributeTLVValueDecoder.cpp @@ -598,180 +598,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::OnOffSwitchConfiguration::Id: { - using namespace app::Clusters::OnOffSwitchConfiguration; - switch (aPath.mAttributeId) - { - case Attributes::SwitchType::Id: { - using TypeInfo = Attributes::SwitchType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::SwitchActions::Id: { - using TypeInfo = Attributes::SwitchActions::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - break; - } - break; - } case app::Clusters::LevelControl::Id: { using namespace app::Clusters::LevelControl; switch (aPath.mAttributeId) @@ -1180,280 +1006,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::BinaryInputBasic::Id: { - using namespace app::Clusters::BinaryInputBasic; - switch (aPath.mAttributeId) - { - case Attributes::ActiveText::Id: { - using TypeInfo = Attributes::ActiveText::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } - case Attributes::Description::Id: { - using TypeInfo = Attributes::Description::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } - case Attributes::InactiveText::Id: { - using TypeInfo = Attributes::InactiveText::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - LogErrorOnFailure(chip::JniReferences::GetInstance().CharToStringUTF(cppValue, value)); - return value; - } - case Attributes::OutOfService::Id: { - using TypeInfo = Attributes::OutOfService::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Boolean"; - std::string valueCtorSignature = "(Z)V"; - jboolean jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::Polarity::Id: { - using TypeInfo = Attributes::Polarity::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::PresentValue::Id: { - using TypeInfo = Attributes::PresentValue::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Boolean"; - std::string valueCtorSignature = "(Z)V"; - jboolean jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::Reliability::Id: { - using TypeInfo = Attributes::Reliability::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::StatusFlags::Id: { - using TypeInfo = Attributes::StatusFlags::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ApplicationType::Id: { - using TypeInfo = Attributes::ApplicationType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - break; - } - break; - } case app::Clusters::PulseWidthModulation::Id: { using namespace app::Clusters::PulseWidthModulation; switch (aPath.mAttributeId) @@ -28304,308 +27856,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::BarrierControl::Id: { - using namespace app::Clusters::BarrierControl; - switch (aPath.mAttributeId) - { - case Attributes::BarrierMovingState::Id: { - using TypeInfo = Attributes::BarrierMovingState::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::BarrierSafetyStatus::Id: { - using TypeInfo = Attributes::BarrierSafetyStatus::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::BarrierCapabilities::Id: { - using TypeInfo = Attributes::BarrierCapabilities::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::BarrierOpenEvents::Id: { - using TypeInfo = Attributes::BarrierOpenEvents::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::BarrierCloseEvents::Id: { - using TypeInfo = Attributes::BarrierCloseEvents::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::BarrierCommandOpenEvents::Id: { - using TypeInfo = Attributes::BarrierCommandOpenEvents::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::BarrierCommandCloseEvents::Id: { - using TypeInfo = Attributes::BarrierCommandCloseEvents::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::BarrierOpenPeriod::Id: { - using TypeInfo = Attributes::BarrierOpenPeriod::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::BarrierClosePeriod::Id: { - using TypeInfo = Attributes::BarrierClosePeriod::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::BarrierPosition::Id: { - using TypeInfo = Attributes::BarrierPosition::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - break; - } - break; - } case app::Clusters::ServiceArea::Id: { using namespace app::Clusters::ServiceArea; switch (aPath.mAttributeId) @@ -43561,2196 +42811,6 @@ jobject DecodeAttributeValue(const app::ConcreteAttributePath & aPath, TLV::TLVR } break; } - case app::Clusters::ElectricalMeasurement::Id: { - using namespace app::Clusters::ElectricalMeasurement; - switch (aPath.mAttributeId) - { - case Attributes::MeasurementType::Id: { - using TypeInfo = Attributes::MeasurementType::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::DcVoltage::Id: { - using TypeInfo = Attributes::DcVoltage::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DcVoltageMin::Id: { - using TypeInfo = Attributes::DcVoltageMin::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DcVoltageMax::Id: { - using TypeInfo = Attributes::DcVoltageMax::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DcCurrent::Id: { - using TypeInfo = Attributes::DcCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DcCurrentMin::Id: { - using TypeInfo = Attributes::DcCurrentMin::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DcCurrentMax::Id: { - using TypeInfo = Attributes::DcCurrentMax::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DcPower::Id: { - using TypeInfo = Attributes::DcPower::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DcPowerMin::Id: { - using TypeInfo = Attributes::DcPowerMin::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DcPowerMax::Id: { - using TypeInfo = Attributes::DcPowerMax::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DcVoltageMultiplier::Id: { - using TypeInfo = Attributes::DcVoltageMultiplier::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DcVoltageDivisor::Id: { - using TypeInfo = Attributes::DcVoltageDivisor::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DcCurrentMultiplier::Id: { - using TypeInfo = Attributes::DcCurrentMultiplier::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DcCurrentDivisor::Id: { - using TypeInfo = Attributes::DcCurrentDivisor::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DcPowerMultiplier::Id: { - using TypeInfo = Attributes::DcPowerMultiplier::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::DcPowerDivisor::Id: { - using TypeInfo = Attributes::DcPowerDivisor::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcFrequency::Id: { - using TypeInfo = Attributes::AcFrequency::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcFrequencyMin::Id: { - using TypeInfo = Attributes::AcFrequencyMin::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcFrequencyMax::Id: { - using TypeInfo = Attributes::AcFrequencyMax::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::NeutralCurrent::Id: { - using TypeInfo = Attributes::NeutralCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::TotalActivePower::Id: { - using TypeInfo = Attributes::TotalActivePower::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::TotalReactivePower::Id: { - using TypeInfo = Attributes::TotalReactivePower::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::TotalApparentPower::Id: { - using TypeInfo = Attributes::TotalApparentPower::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::Measured1stHarmonicCurrent::Id: { - using TypeInfo = Attributes::Measured1stHarmonicCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::Measured3rdHarmonicCurrent::Id: { - using TypeInfo = Attributes::Measured3rdHarmonicCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::Measured5thHarmonicCurrent::Id: { - using TypeInfo = Attributes::Measured5thHarmonicCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::Measured7thHarmonicCurrent::Id: { - using TypeInfo = Attributes::Measured7thHarmonicCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::Measured9thHarmonicCurrent::Id: { - using TypeInfo = Attributes::Measured9thHarmonicCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::Measured11thHarmonicCurrent::Id: { - using TypeInfo = Attributes::Measured11thHarmonicCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::MeasuredPhase1stHarmonicCurrent::Id: { - using TypeInfo = Attributes::MeasuredPhase1stHarmonicCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::MeasuredPhase3rdHarmonicCurrent::Id: { - using TypeInfo = Attributes::MeasuredPhase3rdHarmonicCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::MeasuredPhase5thHarmonicCurrent::Id: { - using TypeInfo = Attributes::MeasuredPhase5thHarmonicCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::MeasuredPhase7thHarmonicCurrent::Id: { - using TypeInfo = Attributes::MeasuredPhase7thHarmonicCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::MeasuredPhase9thHarmonicCurrent::Id: { - using TypeInfo = Attributes::MeasuredPhase9thHarmonicCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::MeasuredPhase11thHarmonicCurrent::Id: { - using TypeInfo = Attributes::MeasuredPhase11thHarmonicCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcFrequencyMultiplier::Id: { - using TypeInfo = Attributes::AcFrequencyMultiplier::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcFrequencyDivisor::Id: { - using TypeInfo = Attributes::AcFrequencyDivisor::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::PowerMultiplier::Id: { - using TypeInfo = Attributes::PowerMultiplier::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::PowerDivisor::Id: { - using TypeInfo = Attributes::PowerDivisor::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::HarmonicCurrentMultiplier::Id: { - using TypeInfo = Attributes::HarmonicCurrentMultiplier::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::PhaseHarmonicCurrentMultiplier::Id: { - using TypeInfo = Attributes::PhaseHarmonicCurrentMultiplier::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::InstantaneousVoltage::Id: { - using TypeInfo = Attributes::InstantaneousVoltage::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::InstantaneousLineCurrent::Id: { - using TypeInfo = Attributes::InstantaneousLineCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::InstantaneousActiveCurrent::Id: { - using TypeInfo = Attributes::InstantaneousActiveCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::InstantaneousReactiveCurrent::Id: { - using TypeInfo = Attributes::InstantaneousReactiveCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::InstantaneousPower::Id: { - using TypeInfo = Attributes::InstantaneousPower::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltage::Id: { - using TypeInfo = Attributes::RmsVoltage::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltageMin::Id: { - using TypeInfo = Attributes::RmsVoltageMin::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltageMax::Id: { - using TypeInfo = Attributes::RmsVoltageMax::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsCurrent::Id: { - using TypeInfo = Attributes::RmsCurrent::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsCurrentMin::Id: { - using TypeInfo = Attributes::RmsCurrentMin::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsCurrentMax::Id: { - using TypeInfo = Attributes::RmsCurrentMax::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ActivePower::Id: { - using TypeInfo = Attributes::ActivePower::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ActivePowerMin::Id: { - using TypeInfo = Attributes::ActivePowerMin::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ActivePowerMax::Id: { - using TypeInfo = Attributes::ActivePowerMax::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ReactivePower::Id: { - using TypeInfo = Attributes::ReactivePower::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ApparentPower::Id: { - using TypeInfo = Attributes::ApparentPower::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::PowerFactor::Id: { - using TypeInfo = Attributes::PowerFactor::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AverageRmsVoltageMeasurementPeriod::Id: { - using TypeInfo = Attributes::AverageRmsVoltageMeasurementPeriod::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AverageRmsUnderVoltageCounter::Id: { - using TypeInfo = Attributes::AverageRmsUnderVoltageCounter::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsExtremeOverVoltagePeriod::Id: { - using TypeInfo = Attributes::RmsExtremeOverVoltagePeriod::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsExtremeUnderVoltagePeriod::Id: { - using TypeInfo = Attributes::RmsExtremeUnderVoltagePeriod::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltageSagPeriod::Id: { - using TypeInfo = Attributes::RmsVoltageSagPeriod::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltageSwellPeriod::Id: { - using TypeInfo = Attributes::RmsVoltageSwellPeriod::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcVoltageMultiplier::Id: { - using TypeInfo = Attributes::AcVoltageMultiplier::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcVoltageDivisor::Id: { - using TypeInfo = Attributes::AcVoltageDivisor::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcCurrentMultiplier::Id: { - using TypeInfo = Attributes::AcCurrentMultiplier::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcCurrentDivisor::Id: { - using TypeInfo = Attributes::AcCurrentDivisor::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcPowerMultiplier::Id: { - using TypeInfo = Attributes::AcPowerMultiplier::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcPowerDivisor::Id: { - using TypeInfo = Attributes::AcPowerDivisor::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::OverloadAlarmsMask::Id: { - using TypeInfo = Attributes::OverloadAlarmsMask::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::VoltageOverload::Id: { - using TypeInfo = Attributes::VoltageOverload::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::CurrentOverload::Id: { - using TypeInfo = Attributes::CurrentOverload::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcOverloadAlarmsMask::Id: { - using TypeInfo = Attributes::AcOverloadAlarmsMask::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcVoltageOverload::Id: { - using TypeInfo = Attributes::AcVoltageOverload::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcCurrentOverload::Id: { - using TypeInfo = Attributes::AcCurrentOverload::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcActivePowerOverload::Id: { - using TypeInfo = Attributes::AcActivePowerOverload::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AcReactivePowerOverload::Id: { - using TypeInfo = Attributes::AcReactivePowerOverload::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AverageRmsOverVoltage::Id: { - using TypeInfo = Attributes::AverageRmsOverVoltage::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AverageRmsUnderVoltage::Id: { - using TypeInfo = Attributes::AverageRmsUnderVoltage::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsExtremeOverVoltage::Id: { - using TypeInfo = Attributes::RmsExtremeOverVoltage::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsExtremeUnderVoltage::Id: { - using TypeInfo = Attributes::RmsExtremeUnderVoltage::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltageSag::Id: { - using TypeInfo = Attributes::RmsVoltageSag::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltageSwell::Id: { - using TypeInfo = Attributes::RmsVoltageSwell::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::LineCurrentPhaseB::Id: { - using TypeInfo = Attributes::LineCurrentPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ActiveCurrentPhaseB::Id: { - using TypeInfo = Attributes::ActiveCurrentPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ReactiveCurrentPhaseB::Id: { - using TypeInfo = Attributes::ReactiveCurrentPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltagePhaseB::Id: { - using TypeInfo = Attributes::RmsVoltagePhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltageMinPhaseB::Id: { - using TypeInfo = Attributes::RmsVoltageMinPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltageMaxPhaseB::Id: { - using TypeInfo = Attributes::RmsVoltageMaxPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsCurrentPhaseB::Id: { - using TypeInfo = Attributes::RmsCurrentPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsCurrentMinPhaseB::Id: { - using TypeInfo = Attributes::RmsCurrentMinPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsCurrentMaxPhaseB::Id: { - using TypeInfo = Attributes::RmsCurrentMaxPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ActivePowerPhaseB::Id: { - using TypeInfo = Attributes::ActivePowerPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ActivePowerMinPhaseB::Id: { - using TypeInfo = Attributes::ActivePowerMinPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ActivePowerMaxPhaseB::Id: { - using TypeInfo = Attributes::ActivePowerMaxPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ReactivePowerPhaseB::Id: { - using TypeInfo = Attributes::ReactivePowerPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ApparentPowerPhaseB::Id: { - using TypeInfo = Attributes::ApparentPowerPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::PowerFactorPhaseB::Id: { - using TypeInfo = Attributes::PowerFactorPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::Id: { - using TypeInfo = Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AverageRmsOverVoltageCounterPhaseB::Id: { - using TypeInfo = Attributes::AverageRmsOverVoltageCounterPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AverageRmsUnderVoltageCounterPhaseB::Id: { - using TypeInfo = Attributes::AverageRmsUnderVoltageCounterPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsExtremeOverVoltagePeriodPhaseB::Id: { - using TypeInfo = Attributes::RmsExtremeOverVoltagePeriodPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsExtremeUnderVoltagePeriodPhaseB::Id: { - using TypeInfo = Attributes::RmsExtremeUnderVoltagePeriodPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltageSagPeriodPhaseB::Id: { - using TypeInfo = Attributes::RmsVoltageSagPeriodPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltageSwellPeriodPhaseB::Id: { - using TypeInfo = Attributes::RmsVoltageSwellPeriodPhaseB::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::LineCurrentPhaseC::Id: { - using TypeInfo = Attributes::LineCurrentPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ActiveCurrentPhaseC::Id: { - using TypeInfo = Attributes::ActiveCurrentPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ReactiveCurrentPhaseC::Id: { - using TypeInfo = Attributes::ReactiveCurrentPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltagePhaseC::Id: { - using TypeInfo = Attributes::RmsVoltagePhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltageMinPhaseC::Id: { - using TypeInfo = Attributes::RmsVoltageMinPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltageMaxPhaseC::Id: { - using TypeInfo = Attributes::RmsVoltageMaxPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsCurrentPhaseC::Id: { - using TypeInfo = Attributes::RmsCurrentPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsCurrentMinPhaseC::Id: { - using TypeInfo = Attributes::RmsCurrentMinPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsCurrentMaxPhaseC::Id: { - using TypeInfo = Attributes::RmsCurrentMaxPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ActivePowerPhaseC::Id: { - using TypeInfo = Attributes::ActivePowerPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ActivePowerMinPhaseC::Id: { - using TypeInfo = Attributes::ActivePowerMinPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ActivePowerMaxPhaseC::Id: { - using TypeInfo = Attributes::ActivePowerMaxPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ReactivePowerPhaseC::Id: { - using TypeInfo = Attributes::ReactivePowerPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::ApparentPowerPhaseC::Id: { - using TypeInfo = Attributes::ApparentPowerPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::PowerFactorPhaseC::Id: { - using TypeInfo = Attributes::PowerFactorPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::Id: { - using TypeInfo = Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AverageRmsOverVoltageCounterPhaseC::Id: { - using TypeInfo = Attributes::AverageRmsOverVoltageCounterPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::AverageRmsUnderVoltageCounterPhaseC::Id: { - using TypeInfo = Attributes::AverageRmsUnderVoltageCounterPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsExtremeOverVoltagePeriodPhaseC::Id: { - using TypeInfo = Attributes::RmsExtremeOverVoltagePeriodPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsExtremeUnderVoltagePeriodPhaseC::Id: { - using TypeInfo = Attributes::RmsExtremeUnderVoltagePeriodPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltageSagPeriodPhaseC::Id: { - using TypeInfo = Attributes::RmsVoltageSagPeriodPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::RmsVoltageSwellPeriodPhaseC::Id: { - using TypeInfo = Attributes::RmsVoltageSwellPeriodPhaseC::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - case Attributes::GeneratedCommandList::Id: { - using TypeInfo = Attributes::GeneratedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AcceptedCommandList::Id: { - using TypeInfo = Attributes::AcceptedCommandList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::EventList::Id: { - using TypeInfo = Attributes::EventList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::AttributeList::Id: { - using TypeInfo = Attributes::AttributeList::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - chip::JniReferences::GetInstance().CreateArrayList(value); - - auto iter_value_0 = cppValue.begin(); - while (iter_value_0.Next()) - { - auto & entry_0 = iter_value_0.GetValue(); - jobject newElement_0; - std::string newElement_0ClassName = "java/lang/Long"; - std::string newElement_0CtorSignature = "(J)V"; - jlong jninewElement_0 = static_cast(entry_0); - chip::JniReferences::GetInstance().CreateBoxedObject( - newElement_0ClassName.c_str(), newElement_0CtorSignature.c_str(), jninewElement_0, newElement_0); - chip::JniReferences::GetInstance().AddToList(value, newElement_0); - } - return value; - } - case Attributes::FeatureMap::Id: { - using TypeInfo = Attributes::FeatureMap::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Long"; - std::string valueCtorSignature = "(J)V"; - jlong jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), - jnivalue, value); - return value; - } - case Attributes::ClusterRevision::Id: { - using TypeInfo = Attributes::ClusterRevision::TypeInfo; - TypeInfo::DecodableType cppValue; - *aError = app::DataModel::Decode(aReader, cppValue); - if (*aError != CHIP_NO_ERROR) - { - return nullptr; - } - jobject value; - std::string valueClassName = "java/lang/Integer"; - std::string valueCtorSignature = "(I)V"; - jint jnivalue = static_cast(cppValue); - chip::JniReferences::GetInstance().CreateBoxedObject(valueClassName.c_str(), valueCtorSignature.c_str(), jnivalue, - value); - return value; - } - default: - *aError = CHIP_ERROR_IM_MALFORMED_ATTRIBUTE_PATH_IB; - break; - } - break; - } case app::Clusters::UnitTesting::Id: { using namespace app::Clusters::UnitTesting; switch (aPath.mAttributeId) diff --git a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp index a133eceb499a0f..dd385a777c9276 100644 --- a/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp +++ b/src/controller/java/zap-generated/CHIPEventTLVValueDecoder.cpp @@ -67,16 +67,6 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::OnOffSwitchConfiguration::Id: { - using namespace app::Clusters::OnOffSwitchConfiguration; - switch (aPath.mEventId) - { - default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - break; - } - break; - } case app::Clusters::LevelControl::Id: { using namespace app::Clusters::LevelControl; switch (aPath.mEventId) @@ -87,16 +77,6 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::BinaryInputBasic::Id: { - using namespace app::Clusters::BinaryInputBasic; - switch (aPath.mEventId) - { - default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - break; - } - break; - } case app::Clusters::PulseWidthModulation::Id: { using namespace app::Clusters::PulseWidthModulation; switch (aPath.mEventId) @@ -6987,16 +6967,6 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::BarrierControl::Id: { - using namespace app::Clusters::BarrierControl; - switch (aPath.mEventId) - { - default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - break; - } - break; - } case app::Clusters::ServiceArea::Id: { using namespace app::Clusters::ServiceArea; switch (aPath.mEventId) @@ -8362,16 +8332,6 @@ jobject DecodeEventValue(const app::ConcreteEventPath & aPath, TLV::TLVReader & } break; } - case app::Clusters::ElectricalMeasurement::Id: { - using namespace app::Clusters::ElectricalMeasurement; - switch (aPath.mEventId) - { - default: - *aError = CHIP_ERROR_IM_MALFORMED_EVENT_PATH_IB; - break; - } - break; - } case app::Clusters::UnitTesting::Id: { using namespace app::Clusters::UnitTesting; switch (aPath.mEventId) diff --git a/src/controller/python/chip/clusters/CHIPClusters.py b/src/controller/python/chip/clusters/CHIPClusters.py index 268dd1abfb574c..af684af705969f 100644 --- a/src/controller/python/chip/clusters/CHIPClusters.py +++ b/src/controller/python/chip/clusters/CHIPClusters.py @@ -313,63 +313,6 @@ class ChipClusters: }, }, } - _ON_OFF_SWITCH_CONFIGURATION_CLUSTER_INFO = { - "clusterName": "OnOffSwitchConfiguration", - "clusterId": 0x00000007, - "commands": { - }, - "attributes": { - 0x00000000: { - "attributeName": "SwitchType", - "attributeId": 0x00000000, - "type": "int", - "reportable": True, - }, - 0x00000010: { - "attributeName": "SwitchActions", - "attributeId": 0x00000010, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x0000FFF8: { - "attributeName": "GeneratedCommandList", - "attributeId": 0x0000FFF8, - "type": "int", - "reportable": True, - }, - 0x0000FFF9: { - "attributeName": "AcceptedCommandList", - "attributeId": 0x0000FFF9, - "type": "int", - "reportable": True, - }, - 0x0000FFFA: { - "attributeName": "EventList", - "attributeId": 0x0000FFFA, - "type": "int", - "reportable": True, - }, - 0x0000FFFB: { - "attributeName": "AttributeList", - "attributeId": 0x0000FFFB, - "type": "int", - "reportable": True, - }, - 0x0000FFFC: { - "attributeName": "FeatureMap", - "attributeId": 0x0000FFFC, - "type": "int", - "reportable": True, - }, - 0x0000FFFD: { - "attributeName": "ClusterRevision", - "attributeId": 0x0000FFFD, - "type": "int", - "reportable": True, - }, - }, - } _LEVEL_CONTROL_CLUSTER_INFO = { "clusterName": "LevelControl", "clusterId": 0x00000008, @@ -590,110 +533,6 @@ class ChipClusters: }, }, } - _BINARY_INPUT_BASIC_CLUSTER_INFO = { - "clusterName": "BinaryInputBasic", - "clusterId": 0x0000000F, - "commands": { - }, - "attributes": { - 0x00000004: { - "attributeName": "ActiveText", - "attributeId": 0x00000004, - "type": "str", - "reportable": True, - "writable": True, - }, - 0x0000001C: { - "attributeName": "Description", - "attributeId": 0x0000001C, - "type": "str", - "reportable": True, - "writable": True, - }, - 0x0000002E: { - "attributeName": "InactiveText", - "attributeId": 0x0000002E, - "type": "str", - "reportable": True, - "writable": True, - }, - 0x00000051: { - "attributeName": "OutOfService", - "attributeId": 0x00000051, - "type": "bool", - "reportable": True, - "writable": True, - }, - 0x00000054: { - "attributeName": "Polarity", - "attributeId": 0x00000054, - "type": "int", - "reportable": True, - }, - 0x00000055: { - "attributeName": "PresentValue", - "attributeId": 0x00000055, - "type": "bool", - "reportable": True, - "writable": True, - }, - 0x00000067: { - "attributeName": "Reliability", - "attributeId": 0x00000067, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x0000006F: { - "attributeName": "StatusFlags", - "attributeId": 0x0000006F, - "type": "int", - "reportable": True, - }, - 0x00000100: { - "attributeName": "ApplicationType", - "attributeId": 0x00000100, - "type": "int", - "reportable": True, - }, - 0x0000FFF8: { - "attributeName": "GeneratedCommandList", - "attributeId": 0x0000FFF8, - "type": "int", - "reportable": True, - }, - 0x0000FFF9: { - "attributeName": "AcceptedCommandList", - "attributeId": 0x0000FFF9, - "type": "int", - "reportable": True, - }, - 0x0000FFFA: { - "attributeName": "EventList", - "attributeId": 0x0000FFFA, - "type": "int", - "reportable": True, - }, - 0x0000FFFB: { - "attributeName": "AttributeList", - "attributeId": 0x0000FFFB, - "type": "int", - "reportable": True, - }, - 0x0000FFFC: { - "attributeName": "FeatureMap", - "attributeId": 0x0000FFFC, - "type": "int", - "reportable": True, - }, - 0x0000FFFD: { - "attributeName": "ClusterRevision", - "attributeId": 0x0000FFFD, - "type": "int", - "reportable": True, - }, - }, - } _PULSE_WIDTH_MODULATION_CLUSTER_INFO = { "clusterName": "PulseWidthModulation", "clusterId": 0x0000001C, @@ -8429,129 +8268,6 @@ class ChipClusters: }, }, } - _BARRIER_CONTROL_CLUSTER_INFO = { - "clusterName": "BarrierControl", - "clusterId": 0x00000103, - "commands": { - 0x00000000: { - "commandId": 0x00000000, - "commandName": "BarrierControlGoToPercent", - "args": { - "percentOpen": "int", - }, - }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "BarrierControlStop", - "args": { - }, - }, - }, - "attributes": { - 0x00000001: { - "attributeName": "BarrierMovingState", - "attributeId": 0x00000001, - "type": "int", - "reportable": True, - }, - 0x00000002: { - "attributeName": "BarrierSafetyStatus", - "attributeId": 0x00000002, - "type": "int", - "reportable": True, - }, - 0x00000003: { - "attributeName": "BarrierCapabilities", - "attributeId": 0x00000003, - "type": "int", - "reportable": True, - }, - 0x00000004: { - "attributeName": "BarrierOpenEvents", - "attributeId": 0x00000004, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000005: { - "attributeName": "BarrierCloseEvents", - "attributeId": 0x00000005, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000006: { - "attributeName": "BarrierCommandOpenEvents", - "attributeId": 0x00000006, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000007: { - "attributeName": "BarrierCommandCloseEvents", - "attributeId": 0x00000007, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000008: { - "attributeName": "BarrierOpenPeriod", - "attributeId": 0x00000008, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000009: { - "attributeName": "BarrierClosePeriod", - "attributeId": 0x00000009, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x0000000A: { - "attributeName": "BarrierPosition", - "attributeId": 0x0000000A, - "type": "int", - "reportable": True, - }, - 0x0000FFF8: { - "attributeName": "GeneratedCommandList", - "attributeId": 0x0000FFF8, - "type": "int", - "reportable": True, - }, - 0x0000FFF9: { - "attributeName": "AcceptedCommandList", - "attributeId": 0x0000FFF9, - "type": "int", - "reportable": True, - }, - 0x0000FFFA: { - "attributeName": "EventList", - "attributeId": 0x0000FFFA, - "type": "int", - "reportable": True, - }, - 0x0000FFFB: { - "attributeName": "AttributeList", - "attributeId": 0x0000FFFB, - "type": "int", - "reportable": True, - }, - 0x0000FFFC: { - "attributeName": "FeatureMap", - "attributeId": 0x0000FFFC, - "type": "int", - "reportable": True, - }, - 0x0000FFFD: { - "attributeName": "ClusterRevision", - "attributeId": 0x0000FFFD, - "type": "int", - "reportable": True, - }, - }, - } _SERVICE_AREA_CLUSTER_INFO = { "clusterName": "ServiceArea", "clusterId": 0x00000150, @@ -13437,841 +13153,6 @@ class ChipClusters: }, }, } - _ELECTRICAL_MEASUREMENT_CLUSTER_INFO = { - "clusterName": "ElectricalMeasurement", - "clusterId": 0x00000B04, - "commands": { - 0x00000000: { - "commandId": 0x00000000, - "commandName": "GetProfileInfoCommand", - "args": { - }, - }, - 0x00000001: { - "commandId": 0x00000001, - "commandName": "GetMeasurementProfileCommand", - "args": { - "attributeId": "int", - "startTime": "int", - "numberOfIntervals": "int", - }, - }, - }, - "attributes": { - 0x00000000: { - "attributeName": "MeasurementType", - "attributeId": 0x00000000, - "type": "int", - "reportable": True, - }, - 0x00000100: { - "attributeName": "DcVoltage", - "attributeId": 0x00000100, - "type": "int", - "reportable": True, - }, - 0x00000101: { - "attributeName": "DcVoltageMin", - "attributeId": 0x00000101, - "type": "int", - "reportable": True, - }, - 0x00000102: { - "attributeName": "DcVoltageMax", - "attributeId": 0x00000102, - "type": "int", - "reportable": True, - }, - 0x00000103: { - "attributeName": "DcCurrent", - "attributeId": 0x00000103, - "type": "int", - "reportable": True, - }, - 0x00000104: { - "attributeName": "DcCurrentMin", - "attributeId": 0x00000104, - "type": "int", - "reportable": True, - }, - 0x00000105: { - "attributeName": "DcCurrentMax", - "attributeId": 0x00000105, - "type": "int", - "reportable": True, - }, - 0x00000106: { - "attributeName": "DcPower", - "attributeId": 0x00000106, - "type": "int", - "reportable": True, - }, - 0x00000107: { - "attributeName": "DcPowerMin", - "attributeId": 0x00000107, - "type": "int", - "reportable": True, - }, - 0x00000108: { - "attributeName": "DcPowerMax", - "attributeId": 0x00000108, - "type": "int", - "reportable": True, - }, - 0x00000200: { - "attributeName": "DcVoltageMultiplier", - "attributeId": 0x00000200, - "type": "int", - "reportable": True, - }, - 0x00000201: { - "attributeName": "DcVoltageDivisor", - "attributeId": 0x00000201, - "type": "int", - "reportable": True, - }, - 0x00000202: { - "attributeName": "DcCurrentMultiplier", - "attributeId": 0x00000202, - "type": "int", - "reportable": True, - }, - 0x00000203: { - "attributeName": "DcCurrentDivisor", - "attributeId": 0x00000203, - "type": "int", - "reportable": True, - }, - 0x00000204: { - "attributeName": "DcPowerMultiplier", - "attributeId": 0x00000204, - "type": "int", - "reportable": True, - }, - 0x00000205: { - "attributeName": "DcPowerDivisor", - "attributeId": 0x00000205, - "type": "int", - "reportable": True, - }, - 0x00000300: { - "attributeName": "AcFrequency", - "attributeId": 0x00000300, - "type": "int", - "reportable": True, - }, - 0x00000301: { - "attributeName": "AcFrequencyMin", - "attributeId": 0x00000301, - "type": "int", - "reportable": True, - }, - 0x00000302: { - "attributeName": "AcFrequencyMax", - "attributeId": 0x00000302, - "type": "int", - "reportable": True, - }, - 0x00000303: { - "attributeName": "NeutralCurrent", - "attributeId": 0x00000303, - "type": "int", - "reportable": True, - }, - 0x00000304: { - "attributeName": "TotalActivePower", - "attributeId": 0x00000304, - "type": "int", - "reportable": True, - }, - 0x00000305: { - "attributeName": "TotalReactivePower", - "attributeId": 0x00000305, - "type": "int", - "reportable": True, - }, - 0x00000306: { - "attributeName": "TotalApparentPower", - "attributeId": 0x00000306, - "type": "int", - "reportable": True, - }, - 0x00000307: { - "attributeName": "Measured1stHarmonicCurrent", - "attributeId": 0x00000307, - "type": "int", - "reportable": True, - }, - 0x00000308: { - "attributeName": "Measured3rdHarmonicCurrent", - "attributeId": 0x00000308, - "type": "int", - "reportable": True, - }, - 0x00000309: { - "attributeName": "Measured5thHarmonicCurrent", - "attributeId": 0x00000309, - "type": "int", - "reportable": True, - }, - 0x0000030A: { - "attributeName": "Measured7thHarmonicCurrent", - "attributeId": 0x0000030A, - "type": "int", - "reportable": True, - }, - 0x0000030B: { - "attributeName": "Measured9thHarmonicCurrent", - "attributeId": 0x0000030B, - "type": "int", - "reportable": True, - }, - 0x0000030C: { - "attributeName": "Measured11thHarmonicCurrent", - "attributeId": 0x0000030C, - "type": "int", - "reportable": True, - }, - 0x0000030D: { - "attributeName": "MeasuredPhase1stHarmonicCurrent", - "attributeId": 0x0000030D, - "type": "int", - "reportable": True, - }, - 0x0000030E: { - "attributeName": "MeasuredPhase3rdHarmonicCurrent", - "attributeId": 0x0000030E, - "type": "int", - "reportable": True, - }, - 0x0000030F: { - "attributeName": "MeasuredPhase5thHarmonicCurrent", - "attributeId": 0x0000030F, - "type": "int", - "reportable": True, - }, - 0x00000310: { - "attributeName": "MeasuredPhase7thHarmonicCurrent", - "attributeId": 0x00000310, - "type": "int", - "reportable": True, - }, - 0x00000311: { - "attributeName": "MeasuredPhase9thHarmonicCurrent", - "attributeId": 0x00000311, - "type": "int", - "reportable": True, - }, - 0x00000312: { - "attributeName": "MeasuredPhase11thHarmonicCurrent", - "attributeId": 0x00000312, - "type": "int", - "reportable": True, - }, - 0x00000400: { - "attributeName": "AcFrequencyMultiplier", - "attributeId": 0x00000400, - "type": "int", - "reportable": True, - }, - 0x00000401: { - "attributeName": "AcFrequencyDivisor", - "attributeId": 0x00000401, - "type": "int", - "reportable": True, - }, - 0x00000402: { - "attributeName": "PowerMultiplier", - "attributeId": 0x00000402, - "type": "int", - "reportable": True, - }, - 0x00000403: { - "attributeName": "PowerDivisor", - "attributeId": 0x00000403, - "type": "int", - "reportable": True, - }, - 0x00000404: { - "attributeName": "HarmonicCurrentMultiplier", - "attributeId": 0x00000404, - "type": "int", - "reportable": True, - }, - 0x00000405: { - "attributeName": "PhaseHarmonicCurrentMultiplier", - "attributeId": 0x00000405, - "type": "int", - "reportable": True, - }, - 0x00000500: { - "attributeName": "InstantaneousVoltage", - "attributeId": 0x00000500, - "type": "int", - "reportable": True, - }, - 0x00000501: { - "attributeName": "InstantaneousLineCurrent", - "attributeId": 0x00000501, - "type": "int", - "reportable": True, - }, - 0x00000502: { - "attributeName": "InstantaneousActiveCurrent", - "attributeId": 0x00000502, - "type": "int", - "reportable": True, - }, - 0x00000503: { - "attributeName": "InstantaneousReactiveCurrent", - "attributeId": 0x00000503, - "type": "int", - "reportable": True, - }, - 0x00000504: { - "attributeName": "InstantaneousPower", - "attributeId": 0x00000504, - "type": "int", - "reportable": True, - }, - 0x00000505: { - "attributeName": "RmsVoltage", - "attributeId": 0x00000505, - "type": "int", - "reportable": True, - }, - 0x00000506: { - "attributeName": "RmsVoltageMin", - "attributeId": 0x00000506, - "type": "int", - "reportable": True, - }, - 0x00000507: { - "attributeName": "RmsVoltageMax", - "attributeId": 0x00000507, - "type": "int", - "reportable": True, - }, - 0x00000508: { - "attributeName": "RmsCurrent", - "attributeId": 0x00000508, - "type": "int", - "reportable": True, - }, - 0x00000509: { - "attributeName": "RmsCurrentMin", - "attributeId": 0x00000509, - "type": "int", - "reportable": True, - }, - 0x0000050A: { - "attributeName": "RmsCurrentMax", - "attributeId": 0x0000050A, - "type": "int", - "reportable": True, - }, - 0x0000050B: { - "attributeName": "ActivePower", - "attributeId": 0x0000050B, - "type": "int", - "reportable": True, - }, - 0x0000050C: { - "attributeName": "ActivePowerMin", - "attributeId": 0x0000050C, - "type": "int", - "reportable": True, - }, - 0x0000050D: { - "attributeName": "ActivePowerMax", - "attributeId": 0x0000050D, - "type": "int", - "reportable": True, - }, - 0x0000050E: { - "attributeName": "ReactivePower", - "attributeId": 0x0000050E, - "type": "int", - "reportable": True, - }, - 0x0000050F: { - "attributeName": "ApparentPower", - "attributeId": 0x0000050F, - "type": "int", - "reportable": True, - }, - 0x00000510: { - "attributeName": "PowerFactor", - "attributeId": 0x00000510, - "type": "int", - "reportable": True, - }, - 0x00000511: { - "attributeName": "AverageRmsVoltageMeasurementPeriod", - "attributeId": 0x00000511, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000513: { - "attributeName": "AverageRmsUnderVoltageCounter", - "attributeId": 0x00000513, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000514: { - "attributeName": "RmsExtremeOverVoltagePeriod", - "attributeId": 0x00000514, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000515: { - "attributeName": "RmsExtremeUnderVoltagePeriod", - "attributeId": 0x00000515, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000516: { - "attributeName": "RmsVoltageSagPeriod", - "attributeId": 0x00000516, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000517: { - "attributeName": "RmsVoltageSwellPeriod", - "attributeId": 0x00000517, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000600: { - "attributeName": "AcVoltageMultiplier", - "attributeId": 0x00000600, - "type": "int", - "reportable": True, - }, - 0x00000601: { - "attributeName": "AcVoltageDivisor", - "attributeId": 0x00000601, - "type": "int", - "reportable": True, - }, - 0x00000602: { - "attributeName": "AcCurrentMultiplier", - "attributeId": 0x00000602, - "type": "int", - "reportable": True, - }, - 0x00000603: { - "attributeName": "AcCurrentDivisor", - "attributeId": 0x00000603, - "type": "int", - "reportable": True, - }, - 0x00000604: { - "attributeName": "AcPowerMultiplier", - "attributeId": 0x00000604, - "type": "int", - "reportable": True, - }, - 0x00000605: { - "attributeName": "AcPowerDivisor", - "attributeId": 0x00000605, - "type": "int", - "reportable": True, - }, - 0x00000700: { - "attributeName": "OverloadAlarmsMask", - "attributeId": 0x00000700, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000701: { - "attributeName": "VoltageOverload", - "attributeId": 0x00000701, - "type": "int", - "reportable": True, - }, - 0x00000702: { - "attributeName": "CurrentOverload", - "attributeId": 0x00000702, - "type": "int", - "reportable": True, - }, - 0x00000800: { - "attributeName": "AcOverloadAlarmsMask", - "attributeId": 0x00000800, - "type": "int", - "reportable": True, - "writable": True, - }, - 0x00000801: { - "attributeName": "AcVoltageOverload", - "attributeId": 0x00000801, - "type": "int", - "reportable": True, - }, - 0x00000802: { - "attributeName": "AcCurrentOverload", - "attributeId": 0x00000802, - "type": "int", - "reportable": True, - }, - 0x00000803: { - "attributeName": "AcActivePowerOverload", - "attributeId": 0x00000803, - "type": "int", - "reportable": True, - }, - 0x00000804: { - "attributeName": "AcReactivePowerOverload", - "attributeId": 0x00000804, - "type": "int", - "reportable": True, - }, - 0x00000805: { - "attributeName": "AverageRmsOverVoltage", - "attributeId": 0x00000805, - "type": "int", - "reportable": True, - }, - 0x00000806: { - "attributeName": "AverageRmsUnderVoltage", - "attributeId": 0x00000806, - "type": "int", - "reportable": True, - }, - 0x00000807: { - "attributeName": "RmsExtremeOverVoltage", - "attributeId": 0x00000807, - "type": "int", - "reportable": True, - }, - 0x00000808: { - "attributeName": "RmsExtremeUnderVoltage", - "attributeId": 0x00000808, - "type": "int", - "reportable": True, - }, - 0x00000809: { - "attributeName": "RmsVoltageSag", - "attributeId": 0x00000809, - "type": "int", - "reportable": True, - }, - 0x0000080A: { - "attributeName": "RmsVoltageSwell", - "attributeId": 0x0000080A, - "type": "int", - "reportable": True, - }, - 0x00000901: { - "attributeName": "LineCurrentPhaseB", - "attributeId": 0x00000901, - "type": "int", - "reportable": True, - }, - 0x00000902: { - "attributeName": "ActiveCurrentPhaseB", - "attributeId": 0x00000902, - "type": "int", - "reportable": True, - }, - 0x00000903: { - "attributeName": "ReactiveCurrentPhaseB", - "attributeId": 0x00000903, - "type": "int", - "reportable": True, - }, - 0x00000905: { - "attributeName": "RmsVoltagePhaseB", - "attributeId": 0x00000905, - "type": "int", - "reportable": True, - }, - 0x00000906: { - "attributeName": "RmsVoltageMinPhaseB", - "attributeId": 0x00000906, - "type": "int", - "reportable": True, - }, - 0x00000907: { - "attributeName": "RmsVoltageMaxPhaseB", - "attributeId": 0x00000907, - "type": "int", - "reportable": True, - }, - 0x00000908: { - "attributeName": "RmsCurrentPhaseB", - "attributeId": 0x00000908, - "type": "int", - "reportable": True, - }, - 0x00000909: { - "attributeName": "RmsCurrentMinPhaseB", - "attributeId": 0x00000909, - "type": "int", - "reportable": True, - }, - 0x0000090A: { - "attributeName": "RmsCurrentMaxPhaseB", - "attributeId": 0x0000090A, - "type": "int", - "reportable": True, - }, - 0x0000090B: { - "attributeName": "ActivePowerPhaseB", - "attributeId": 0x0000090B, - "type": "int", - "reportable": True, - }, - 0x0000090C: { - "attributeName": "ActivePowerMinPhaseB", - "attributeId": 0x0000090C, - "type": "int", - "reportable": True, - }, - 0x0000090D: { - "attributeName": "ActivePowerMaxPhaseB", - "attributeId": 0x0000090D, - "type": "int", - "reportable": True, - }, - 0x0000090E: { - "attributeName": "ReactivePowerPhaseB", - "attributeId": 0x0000090E, - "type": "int", - "reportable": True, - }, - 0x0000090F: { - "attributeName": "ApparentPowerPhaseB", - "attributeId": 0x0000090F, - "type": "int", - "reportable": True, - }, - 0x00000910: { - "attributeName": "PowerFactorPhaseB", - "attributeId": 0x00000910, - "type": "int", - "reportable": True, - }, - 0x00000911: { - "attributeName": "AverageRmsVoltageMeasurementPeriodPhaseB", - "attributeId": 0x00000911, - "type": "int", - "reportable": True, - }, - 0x00000912: { - "attributeName": "AverageRmsOverVoltageCounterPhaseB", - "attributeId": 0x00000912, - "type": "int", - "reportable": True, - }, - 0x00000913: { - "attributeName": "AverageRmsUnderVoltageCounterPhaseB", - "attributeId": 0x00000913, - "type": "int", - "reportable": True, - }, - 0x00000914: { - "attributeName": "RmsExtremeOverVoltagePeriodPhaseB", - "attributeId": 0x00000914, - "type": "int", - "reportable": True, - }, - 0x00000915: { - "attributeName": "RmsExtremeUnderVoltagePeriodPhaseB", - "attributeId": 0x00000915, - "type": "int", - "reportable": True, - }, - 0x00000916: { - "attributeName": "RmsVoltageSagPeriodPhaseB", - "attributeId": 0x00000916, - "type": "int", - "reportable": True, - }, - 0x00000917: { - "attributeName": "RmsVoltageSwellPeriodPhaseB", - "attributeId": 0x00000917, - "type": "int", - "reportable": True, - }, - 0x00000A01: { - "attributeName": "LineCurrentPhaseC", - "attributeId": 0x00000A01, - "type": "int", - "reportable": True, - }, - 0x00000A02: { - "attributeName": "ActiveCurrentPhaseC", - "attributeId": 0x00000A02, - "type": "int", - "reportable": True, - }, - 0x00000A03: { - "attributeName": "ReactiveCurrentPhaseC", - "attributeId": 0x00000A03, - "type": "int", - "reportable": True, - }, - 0x00000A05: { - "attributeName": "RmsVoltagePhaseC", - "attributeId": 0x00000A05, - "type": "int", - "reportable": True, - }, - 0x00000A06: { - "attributeName": "RmsVoltageMinPhaseC", - "attributeId": 0x00000A06, - "type": "int", - "reportable": True, - }, - 0x00000A07: { - "attributeName": "RmsVoltageMaxPhaseC", - "attributeId": 0x00000A07, - "type": "int", - "reportable": True, - }, - 0x00000A08: { - "attributeName": "RmsCurrentPhaseC", - "attributeId": 0x00000A08, - "type": "int", - "reportable": True, - }, - 0x00000A09: { - "attributeName": "RmsCurrentMinPhaseC", - "attributeId": 0x00000A09, - "type": "int", - "reportable": True, - }, - 0x00000A0A: { - "attributeName": "RmsCurrentMaxPhaseC", - "attributeId": 0x00000A0A, - "type": "int", - "reportable": True, - }, - 0x00000A0B: { - "attributeName": "ActivePowerPhaseC", - "attributeId": 0x00000A0B, - "type": "int", - "reportable": True, - }, - 0x00000A0C: { - "attributeName": "ActivePowerMinPhaseC", - "attributeId": 0x00000A0C, - "type": "int", - "reportable": True, - }, - 0x00000A0D: { - "attributeName": "ActivePowerMaxPhaseC", - "attributeId": 0x00000A0D, - "type": "int", - "reportable": True, - }, - 0x00000A0E: { - "attributeName": "ReactivePowerPhaseC", - "attributeId": 0x00000A0E, - "type": "int", - "reportable": True, - }, - 0x00000A0F: { - "attributeName": "ApparentPowerPhaseC", - "attributeId": 0x00000A0F, - "type": "int", - "reportable": True, - }, - 0x00000A10: { - "attributeName": "PowerFactorPhaseC", - "attributeId": 0x00000A10, - "type": "int", - "reportable": True, - }, - 0x00000A11: { - "attributeName": "AverageRmsVoltageMeasurementPeriodPhaseC", - "attributeId": 0x00000A11, - "type": "int", - "reportable": True, - }, - 0x00000A12: { - "attributeName": "AverageRmsOverVoltageCounterPhaseC", - "attributeId": 0x00000A12, - "type": "int", - "reportable": True, - }, - 0x00000A13: { - "attributeName": "AverageRmsUnderVoltageCounterPhaseC", - "attributeId": 0x00000A13, - "type": "int", - "reportable": True, - }, - 0x00000A14: { - "attributeName": "RmsExtremeOverVoltagePeriodPhaseC", - "attributeId": 0x00000A14, - "type": "int", - "reportable": True, - }, - 0x00000A15: { - "attributeName": "RmsExtremeUnderVoltagePeriodPhaseC", - "attributeId": 0x00000A15, - "type": "int", - "reportable": True, - }, - 0x00000A16: { - "attributeName": "RmsVoltageSagPeriodPhaseC", - "attributeId": 0x00000A16, - "type": "int", - "reportable": True, - }, - 0x00000A17: { - "attributeName": "RmsVoltageSwellPeriodPhaseC", - "attributeId": 0x00000A17, - "type": "int", - "reportable": True, - }, - 0x0000FFF8: { - "attributeName": "GeneratedCommandList", - "attributeId": 0x0000FFF8, - "type": "int", - "reportable": True, - }, - 0x0000FFF9: { - "attributeName": "AcceptedCommandList", - "attributeId": 0x0000FFF9, - "type": "int", - "reportable": True, - }, - 0x0000FFFA: { - "attributeName": "EventList", - "attributeId": 0x0000FFFA, - "type": "int", - "reportable": True, - }, - 0x0000FFFB: { - "attributeName": "AttributeList", - "attributeId": 0x0000FFFB, - "type": "int", - "reportable": True, - }, - 0x0000FFFC: { - "attributeName": "FeatureMap", - "attributeId": 0x0000FFFC, - "type": "int", - "reportable": True, - }, - 0x0000FFFD: { - "attributeName": "ClusterRevision", - "attributeId": 0x0000FFFD, - "type": "int", - "reportable": True, - }, - }, - } _UNIT_TESTING_CLUSTER_INFO = { "clusterName": "UnitTesting", "clusterId": 0xFFF1FC05, @@ -15282,9 +14163,7 @@ class ChipClusters: 0x00000003: _IDENTIFY_CLUSTER_INFO, 0x00000004: _GROUPS_CLUSTER_INFO, 0x00000006: _ON_OFF_CLUSTER_INFO, - 0x00000007: _ON_OFF_SWITCH_CONFIGURATION_CLUSTER_INFO, 0x00000008: _LEVEL_CONTROL_CLUSTER_INFO, - 0x0000000F: _BINARY_INPUT_BASIC_CLUSTER_INFO, 0x0000001C: _PULSE_WIDTH_MODULATION_CLUSTER_INFO, 0x0000001D: _DESCRIPTOR_CLUSTER_INFO, 0x0000001E: _BINDING_CLUSTER_INFO, @@ -15358,7 +14237,6 @@ class ChipClusters: 0x0000009F: _DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER_INFO, 0x00000101: _DOOR_LOCK_CLUSTER_INFO, 0x00000102: _WINDOW_COVERING_CLUSTER_INFO, - 0x00000103: _BARRIER_CONTROL_CLUSTER_INFO, 0x00000150: _SERVICE_AREA_CLUSTER_INFO, 0x00000200: _PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_INFO, 0x00000201: _THERMOSTAT_CLUSTER_INFO, @@ -15401,7 +14279,6 @@ class ChipClusters: 0x00000510: _CONTENT_APP_OBSERVER_CLUSTER_INFO, 0x00000750: _ECOSYSTEM_INFORMATION_CLUSTER_INFO, 0x00000751: _COMMISSIONER_CONTROL_CLUSTER_INFO, - 0x00000B04: _ELECTRICAL_MEASUREMENT_CLUSTER_INFO, 0xFFF1FC05: _UNIT_TESTING_CLUSTER_INFO, 0xFFF1FC06: _FAULT_INJECTION_CLUSTER_INFO, 0xFFF1FC20: _SAMPLE_MEI_CLUSTER_INFO, @@ -15411,9 +14288,7 @@ class ChipClusters: "Identify": _IDENTIFY_CLUSTER_INFO, "Groups": _GROUPS_CLUSTER_INFO, "OnOff": _ON_OFF_CLUSTER_INFO, - "OnOffSwitchConfiguration": _ON_OFF_SWITCH_CONFIGURATION_CLUSTER_INFO, "LevelControl": _LEVEL_CONTROL_CLUSTER_INFO, - "BinaryInputBasic": _BINARY_INPUT_BASIC_CLUSTER_INFO, "PulseWidthModulation": _PULSE_WIDTH_MODULATION_CLUSTER_INFO, "Descriptor": _DESCRIPTOR_CLUSTER_INFO, "Binding": _BINDING_CLUSTER_INFO, @@ -15487,7 +14362,6 @@ class ChipClusters: "DeviceEnergyManagementMode": _DEVICE_ENERGY_MANAGEMENT_MODE_CLUSTER_INFO, "DoorLock": _DOOR_LOCK_CLUSTER_INFO, "WindowCovering": _WINDOW_COVERING_CLUSTER_INFO, - "BarrierControl": _BARRIER_CONTROL_CLUSTER_INFO, "ServiceArea": _SERVICE_AREA_CLUSTER_INFO, "PumpConfigurationAndControl": _PUMP_CONFIGURATION_AND_CONTROL_CLUSTER_INFO, "Thermostat": _THERMOSTAT_CLUSTER_INFO, @@ -15530,7 +14404,6 @@ class ChipClusters: "ContentAppObserver": _CONTENT_APP_OBSERVER_CLUSTER_INFO, "EcosystemInformation": _ECOSYSTEM_INFORMATION_CLUSTER_INFO, "CommissionerControl": _COMMISSIONER_CONTROL_CLUSTER_INFO, - "ElectricalMeasurement": _ELECTRICAL_MEASUREMENT_CLUSTER_INFO, "UnitTesting": _UNIT_TESTING_CLUSTER_INFO, "FaultInjection": _FAULT_INJECTION_CLUSTER_INFO, "SampleMei": _SAMPLE_MEI_CLUSTER_INFO, diff --git a/src/controller/python/chip/clusters/Objects.py b/src/controller/python/chip/clusters/Objects.py index 89f364a79a094e..efefaf9059dd7f 100644 --- a/src/controller/python/chip/clusters/Objects.py +++ b/src/controller/python/chip/clusters/Objects.py @@ -42,9 +42,7 @@ "Identify", "Groups", "OnOff", - "OnOffSwitchConfiguration", "LevelControl", - "BinaryInputBasic", "PulseWidthModulation", "Descriptor", "Binding", @@ -118,7 +116,6 @@ "DeviceEnergyManagementMode", "DoorLock", "WindowCovering", - "BarrierControl", "ServiceArea", "PumpConfigurationAndControl", "Thermostat", @@ -161,7 +158,6 @@ "ContentAppObserver", "EcosystemInformation", "CommissionerControl", - "ElectricalMeasurement", "UnitTesting", "FaultInjection", "SampleMei", @@ -1354,163 +1350,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 -@dataclass -class OnOffSwitchConfiguration(Cluster): - id: typing.ClassVar[int] = 0x00000007 - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="switchType", Tag=0x00000000, Type=uint), - ClusterObjectFieldDescriptor(Label="switchActions", Tag=0x00000010, Type=uint), - ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), - ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), - ]) - - switchType: 'uint' = None - switchActions: 'uint' = None - generatedCommandList: 'typing.List[uint]' = None - acceptedCommandList: 'typing.List[uint]' = None - eventList: 'typing.List[uint]' = None - attributeList: 'typing.List[uint]' = None - featureMap: 'uint' = None - clusterRevision: 'uint' = None - - class Attributes: - @dataclass - class SwitchType(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000007 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class SwitchActions(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000007 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000010 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class GeneratedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000007 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF8 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AcceptedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000007 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF9 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class EventList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000007 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFA - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AttributeList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000007 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFB - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class FeatureMap(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000007 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFC - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class ClusterRevision(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000007 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFD - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass class LevelControl(Cluster): id: typing.ClassVar[int] = 0x00000008 @@ -2102,289 +1941,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 -@dataclass -class BinaryInputBasic(Cluster): - id: typing.ClassVar[int] = 0x0000000F - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="activeText", Tag=0x00000004, Type=typing.Optional[str]), - ClusterObjectFieldDescriptor(Label="description", Tag=0x0000001C, Type=typing.Optional[str]), - ClusterObjectFieldDescriptor(Label="inactiveText", Tag=0x0000002E, Type=typing.Optional[str]), - ClusterObjectFieldDescriptor(Label="outOfService", Tag=0x00000051, Type=bool), - ClusterObjectFieldDescriptor(Label="polarity", Tag=0x00000054, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="presentValue", Tag=0x00000055, Type=bool), - ClusterObjectFieldDescriptor(Label="reliability", Tag=0x00000067, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="statusFlags", Tag=0x0000006F, Type=uint), - ClusterObjectFieldDescriptor(Label="applicationType", Tag=0x00000100, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), - ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), - ]) - - activeText: 'typing.Optional[str]' = None - description: 'typing.Optional[str]' = None - inactiveText: 'typing.Optional[str]' = None - outOfService: 'bool' = None - polarity: 'typing.Optional[uint]' = None - presentValue: 'bool' = None - reliability: 'typing.Optional[uint]' = None - statusFlags: 'uint' = None - applicationType: 'typing.Optional[uint]' = None - generatedCommandList: 'typing.List[uint]' = None - acceptedCommandList: 'typing.List[uint]' = None - eventList: 'typing.List[uint]' = None - attributeList: 'typing.List[uint]' = None - featureMap: 'uint' = None - clusterRevision: 'uint' = None - - class Attributes: - @dataclass - class ActiveText(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000000F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000004 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[str]) - - value: 'typing.Optional[str]' = None - - @dataclass - class Description(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000000F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000001C - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[str]) - - value: 'typing.Optional[str]' = None - - @dataclass - class InactiveText(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000000F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000002E - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[str]) - - value: 'typing.Optional[str]' = None - - @dataclass - class OutOfService(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000000F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000051 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=bool) - - value: 'bool' = False - - @dataclass - class Polarity(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000000F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000054 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class PresentValue(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000000F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000055 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=bool) - - value: 'bool' = False - - @dataclass - class Reliability(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000000F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000067 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class StatusFlags(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000000F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000006F - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class ApplicationType(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000000F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000100 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class GeneratedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000000F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF8 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AcceptedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000000F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF9 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class EventList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000000F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFA - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AttributeList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000000F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFB - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class FeatureMap(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000000F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFC - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class ClusterRevision(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x0000000F - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFD - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass class PulseWidthModulation(Cluster): id: typing.ClassVar[int] = 0x0000001C @@ -31058,347 +30614,6 @@ def attribute_type(cls) -> ClusterObjectFieldDescriptor: value: 'uint' = 0 -@dataclass -class BarrierControl(Cluster): - id: typing.ClassVar[int] = 0x00000103 - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="barrierMovingState", Tag=0x00000001, Type=uint), - ClusterObjectFieldDescriptor(Label="barrierSafetyStatus", Tag=0x00000002, Type=uint), - ClusterObjectFieldDescriptor(Label="barrierCapabilities", Tag=0x00000003, Type=uint), - ClusterObjectFieldDescriptor(Label="barrierOpenEvents", Tag=0x00000004, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="barrierCloseEvents", Tag=0x00000005, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="barrierCommandOpenEvents", Tag=0x00000006, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="barrierCommandCloseEvents", Tag=0x00000007, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="barrierOpenPeriod", Tag=0x00000008, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="barrierClosePeriod", Tag=0x00000009, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="barrierPosition", Tag=0x0000000A, Type=uint), - ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), - ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), - ]) - - barrierMovingState: 'uint' = None - barrierSafetyStatus: 'uint' = None - barrierCapabilities: 'uint' = None - barrierOpenEvents: 'typing.Optional[uint]' = None - barrierCloseEvents: 'typing.Optional[uint]' = None - barrierCommandOpenEvents: 'typing.Optional[uint]' = None - barrierCommandCloseEvents: 'typing.Optional[uint]' = None - barrierOpenPeriod: 'typing.Optional[uint]' = None - barrierClosePeriod: 'typing.Optional[uint]' = None - barrierPosition: 'uint' = None - generatedCommandList: 'typing.List[uint]' = None - acceptedCommandList: 'typing.List[uint]' = None - eventList: 'typing.List[uint]' = None - attributeList: 'typing.List[uint]' = None - featureMap: 'uint' = None - clusterRevision: 'uint' = None - - class Bitmaps: - class BarrierControlCapabilities(IntFlag): - kPartialBarrier = 0x1 - - class BarrierControlSafetyStatus(IntFlag): - kRemoteLockout = 0x1 - kTemperDetected = 0x2 - kFailedCommunication = 0x4 - kPositionFailure = 0x8 - - class Commands: - @dataclass - class BarrierControlGoToPercent(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000103 - command_id: typing.ClassVar[int] = 0x00000000 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="percentOpen", Tag=0, Type=uint), - ]) - - percentOpen: 'uint' = 0 - - @dataclass - class BarrierControlStop(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000103 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ]) - - class Attributes: - @dataclass - class BarrierMovingState(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000001 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class BarrierSafetyStatus(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000002 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class BarrierCapabilities(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000003 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class BarrierOpenEvents(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000004 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class BarrierCloseEvents(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000005 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class BarrierCommandOpenEvents(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000006 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class BarrierCommandCloseEvents(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000007 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class BarrierOpenPeriod(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000008 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class BarrierClosePeriod(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000009 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class BarrierPosition(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000000A - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class GeneratedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF8 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AcceptedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF9 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class EventList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFA - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AttributeList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFB - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class FeatureMap(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFC - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class ClusterRevision(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFD - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass class ServiceArea(Cluster): id: typing.ClassVar[int] = 0x00000150 @@ -47735,2513 +46950,6 @@ def descriptor(cls) -> ClusterObjectDescriptor: fabricIndex: 'uint' = 0 -@dataclass -class ElectricalMeasurement(Cluster): - id: typing.ClassVar[int] = 0x00000B04 - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="measurementType", Tag=0x00000000, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="dcVoltage", Tag=0x00000100, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="dcVoltageMin", Tag=0x00000101, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="dcVoltageMax", Tag=0x00000102, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="dcCurrent", Tag=0x00000103, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="dcCurrentMin", Tag=0x00000104, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="dcCurrentMax", Tag=0x00000105, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="dcPower", Tag=0x00000106, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="dcPowerMin", Tag=0x00000107, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="dcPowerMax", Tag=0x00000108, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="dcVoltageMultiplier", Tag=0x00000200, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="dcVoltageDivisor", Tag=0x00000201, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="dcCurrentMultiplier", Tag=0x00000202, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="dcCurrentDivisor", Tag=0x00000203, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="dcPowerMultiplier", Tag=0x00000204, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="dcPowerDivisor", Tag=0x00000205, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="acFrequency", Tag=0x00000300, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="acFrequencyMin", Tag=0x00000301, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="acFrequencyMax", Tag=0x00000302, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="neutralCurrent", Tag=0x00000303, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="totalActivePower", Tag=0x00000304, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="totalReactivePower", Tag=0x00000305, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="totalApparentPower", Tag=0x00000306, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="measured1stHarmonicCurrent", Tag=0x00000307, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="measured3rdHarmonicCurrent", Tag=0x00000308, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="measured5thHarmonicCurrent", Tag=0x00000309, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="measured7thHarmonicCurrent", Tag=0x0000030A, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="measured9thHarmonicCurrent", Tag=0x0000030B, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="measured11thHarmonicCurrent", Tag=0x0000030C, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="measuredPhase1stHarmonicCurrent", Tag=0x0000030D, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="measuredPhase3rdHarmonicCurrent", Tag=0x0000030E, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="measuredPhase5thHarmonicCurrent", Tag=0x0000030F, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="measuredPhase7thHarmonicCurrent", Tag=0x00000310, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="measuredPhase9thHarmonicCurrent", Tag=0x00000311, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="measuredPhase11thHarmonicCurrent", Tag=0x00000312, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="acFrequencyMultiplier", Tag=0x00000400, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="acFrequencyDivisor", Tag=0x00000401, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="powerMultiplier", Tag=0x00000402, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="powerDivisor", Tag=0x00000403, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="harmonicCurrentMultiplier", Tag=0x00000404, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="phaseHarmonicCurrentMultiplier", Tag=0x00000405, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="instantaneousVoltage", Tag=0x00000500, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="instantaneousLineCurrent", Tag=0x00000501, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="instantaneousActiveCurrent", Tag=0x00000502, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="instantaneousReactiveCurrent", Tag=0x00000503, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="instantaneousPower", Tag=0x00000504, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="rmsVoltage", Tag=0x00000505, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsVoltageMin", Tag=0x00000506, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsVoltageMax", Tag=0x00000507, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsCurrent", Tag=0x00000508, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsCurrentMin", Tag=0x00000509, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsCurrentMax", Tag=0x0000050A, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="activePower", Tag=0x0000050B, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="activePowerMin", Tag=0x0000050C, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="activePowerMax", Tag=0x0000050D, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="reactivePower", Tag=0x0000050E, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="apparentPower", Tag=0x0000050F, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="powerFactor", Tag=0x00000510, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="averageRmsVoltageMeasurementPeriod", Tag=0x00000511, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="averageRmsUnderVoltageCounter", Tag=0x00000513, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsExtremeOverVoltagePeriod", Tag=0x00000514, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsExtremeUnderVoltagePeriod", Tag=0x00000515, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsVoltageSagPeriod", Tag=0x00000516, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsVoltageSwellPeriod", Tag=0x00000517, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="acVoltageMultiplier", Tag=0x00000600, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="acVoltageDivisor", Tag=0x00000601, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="acCurrentMultiplier", Tag=0x00000602, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="acCurrentDivisor", Tag=0x00000603, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="acPowerMultiplier", Tag=0x00000604, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="acPowerDivisor", Tag=0x00000605, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="overloadAlarmsMask", Tag=0x00000700, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="voltageOverload", Tag=0x00000701, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="currentOverload", Tag=0x00000702, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="acOverloadAlarmsMask", Tag=0x00000800, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="acVoltageOverload", Tag=0x00000801, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="acCurrentOverload", Tag=0x00000802, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="acActivePowerOverload", Tag=0x00000803, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="acReactivePowerOverload", Tag=0x00000804, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="averageRmsOverVoltage", Tag=0x00000805, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="averageRmsUnderVoltage", Tag=0x00000806, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="rmsExtremeOverVoltage", Tag=0x00000807, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="rmsExtremeUnderVoltage", Tag=0x00000808, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="rmsVoltageSag", Tag=0x00000809, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="rmsVoltageSwell", Tag=0x0000080A, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="lineCurrentPhaseB", Tag=0x00000901, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="activeCurrentPhaseB", Tag=0x00000902, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="reactiveCurrentPhaseB", Tag=0x00000903, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="rmsVoltagePhaseB", Tag=0x00000905, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsVoltageMinPhaseB", Tag=0x00000906, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsVoltageMaxPhaseB", Tag=0x00000907, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsCurrentPhaseB", Tag=0x00000908, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsCurrentMinPhaseB", Tag=0x00000909, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsCurrentMaxPhaseB", Tag=0x0000090A, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="activePowerPhaseB", Tag=0x0000090B, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="activePowerMinPhaseB", Tag=0x0000090C, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="activePowerMaxPhaseB", Tag=0x0000090D, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="reactivePowerPhaseB", Tag=0x0000090E, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="apparentPowerPhaseB", Tag=0x0000090F, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="powerFactorPhaseB", Tag=0x00000910, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="averageRmsVoltageMeasurementPeriodPhaseB", Tag=0x00000911, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="averageRmsOverVoltageCounterPhaseB", Tag=0x00000912, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="averageRmsUnderVoltageCounterPhaseB", Tag=0x00000913, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsExtremeOverVoltagePeriodPhaseB", Tag=0x00000914, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsExtremeUnderVoltagePeriodPhaseB", Tag=0x00000915, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsVoltageSagPeriodPhaseB", Tag=0x00000916, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsVoltageSwellPeriodPhaseB", Tag=0x00000917, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="lineCurrentPhaseC", Tag=0x00000A01, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="activeCurrentPhaseC", Tag=0x00000A02, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="reactiveCurrentPhaseC", Tag=0x00000A03, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="rmsVoltagePhaseC", Tag=0x00000A05, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsVoltageMinPhaseC", Tag=0x00000A06, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsVoltageMaxPhaseC", Tag=0x00000A07, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsCurrentPhaseC", Tag=0x00000A08, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsCurrentMinPhaseC", Tag=0x00000A09, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsCurrentMaxPhaseC", Tag=0x00000A0A, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="activePowerPhaseC", Tag=0x00000A0B, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="activePowerMinPhaseC", Tag=0x00000A0C, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="activePowerMaxPhaseC", Tag=0x00000A0D, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="reactivePowerPhaseC", Tag=0x00000A0E, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="apparentPowerPhaseC", Tag=0x00000A0F, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="powerFactorPhaseC", Tag=0x00000A10, Type=typing.Optional[int]), - ClusterObjectFieldDescriptor(Label="averageRmsVoltageMeasurementPeriodPhaseC", Tag=0x00000A11, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="averageRmsOverVoltageCounterPhaseC", Tag=0x00000A12, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="averageRmsUnderVoltageCounterPhaseC", Tag=0x00000A13, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsExtremeOverVoltagePeriodPhaseC", Tag=0x00000A14, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsExtremeUnderVoltagePeriodPhaseC", Tag=0x00000A15, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsVoltageSagPeriodPhaseC", Tag=0x00000A16, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="rmsVoltageSwellPeriodPhaseC", Tag=0x00000A17, Type=typing.Optional[uint]), - ClusterObjectFieldDescriptor(Label="generatedCommandList", Tag=0x0000FFF8, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="acceptedCommandList", Tag=0x0000FFF9, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="eventList", Tag=0x0000FFFA, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="attributeList", Tag=0x0000FFFB, Type=typing.List[uint]), - ClusterObjectFieldDescriptor(Label="featureMap", Tag=0x0000FFFC, Type=uint), - ClusterObjectFieldDescriptor(Label="clusterRevision", Tag=0x0000FFFD, Type=uint), - ]) - - measurementType: 'typing.Optional[uint]' = None - dcVoltage: 'typing.Optional[int]' = None - dcVoltageMin: 'typing.Optional[int]' = None - dcVoltageMax: 'typing.Optional[int]' = None - dcCurrent: 'typing.Optional[int]' = None - dcCurrentMin: 'typing.Optional[int]' = None - dcCurrentMax: 'typing.Optional[int]' = None - dcPower: 'typing.Optional[int]' = None - dcPowerMin: 'typing.Optional[int]' = None - dcPowerMax: 'typing.Optional[int]' = None - dcVoltageMultiplier: 'typing.Optional[uint]' = None - dcVoltageDivisor: 'typing.Optional[uint]' = None - dcCurrentMultiplier: 'typing.Optional[uint]' = None - dcCurrentDivisor: 'typing.Optional[uint]' = None - dcPowerMultiplier: 'typing.Optional[uint]' = None - dcPowerDivisor: 'typing.Optional[uint]' = None - acFrequency: 'typing.Optional[uint]' = None - acFrequencyMin: 'typing.Optional[uint]' = None - acFrequencyMax: 'typing.Optional[uint]' = None - neutralCurrent: 'typing.Optional[uint]' = None - totalActivePower: 'typing.Optional[int]' = None - totalReactivePower: 'typing.Optional[int]' = None - totalApparentPower: 'typing.Optional[uint]' = None - measured1stHarmonicCurrent: 'typing.Optional[int]' = None - measured3rdHarmonicCurrent: 'typing.Optional[int]' = None - measured5thHarmonicCurrent: 'typing.Optional[int]' = None - measured7thHarmonicCurrent: 'typing.Optional[int]' = None - measured9thHarmonicCurrent: 'typing.Optional[int]' = None - measured11thHarmonicCurrent: 'typing.Optional[int]' = None - measuredPhase1stHarmonicCurrent: 'typing.Optional[int]' = None - measuredPhase3rdHarmonicCurrent: 'typing.Optional[int]' = None - measuredPhase5thHarmonicCurrent: 'typing.Optional[int]' = None - measuredPhase7thHarmonicCurrent: 'typing.Optional[int]' = None - measuredPhase9thHarmonicCurrent: 'typing.Optional[int]' = None - measuredPhase11thHarmonicCurrent: 'typing.Optional[int]' = None - acFrequencyMultiplier: 'typing.Optional[uint]' = None - acFrequencyDivisor: 'typing.Optional[uint]' = None - powerMultiplier: 'typing.Optional[uint]' = None - powerDivisor: 'typing.Optional[uint]' = None - harmonicCurrentMultiplier: 'typing.Optional[int]' = None - phaseHarmonicCurrentMultiplier: 'typing.Optional[int]' = None - instantaneousVoltage: 'typing.Optional[int]' = None - instantaneousLineCurrent: 'typing.Optional[uint]' = None - instantaneousActiveCurrent: 'typing.Optional[int]' = None - instantaneousReactiveCurrent: 'typing.Optional[int]' = None - instantaneousPower: 'typing.Optional[int]' = None - rmsVoltage: 'typing.Optional[uint]' = None - rmsVoltageMin: 'typing.Optional[uint]' = None - rmsVoltageMax: 'typing.Optional[uint]' = None - rmsCurrent: 'typing.Optional[uint]' = None - rmsCurrentMin: 'typing.Optional[uint]' = None - rmsCurrentMax: 'typing.Optional[uint]' = None - activePower: 'typing.Optional[int]' = None - activePowerMin: 'typing.Optional[int]' = None - activePowerMax: 'typing.Optional[int]' = None - reactivePower: 'typing.Optional[int]' = None - apparentPower: 'typing.Optional[uint]' = None - powerFactor: 'typing.Optional[int]' = None - averageRmsVoltageMeasurementPeriod: 'typing.Optional[uint]' = None - averageRmsUnderVoltageCounter: 'typing.Optional[uint]' = None - rmsExtremeOverVoltagePeriod: 'typing.Optional[uint]' = None - rmsExtremeUnderVoltagePeriod: 'typing.Optional[uint]' = None - rmsVoltageSagPeriod: 'typing.Optional[uint]' = None - rmsVoltageSwellPeriod: 'typing.Optional[uint]' = None - acVoltageMultiplier: 'typing.Optional[uint]' = None - acVoltageDivisor: 'typing.Optional[uint]' = None - acCurrentMultiplier: 'typing.Optional[uint]' = None - acCurrentDivisor: 'typing.Optional[uint]' = None - acPowerMultiplier: 'typing.Optional[uint]' = None - acPowerDivisor: 'typing.Optional[uint]' = None - overloadAlarmsMask: 'typing.Optional[uint]' = None - voltageOverload: 'typing.Optional[int]' = None - currentOverload: 'typing.Optional[int]' = None - acOverloadAlarmsMask: 'typing.Optional[uint]' = None - acVoltageOverload: 'typing.Optional[int]' = None - acCurrentOverload: 'typing.Optional[int]' = None - acActivePowerOverload: 'typing.Optional[int]' = None - acReactivePowerOverload: 'typing.Optional[int]' = None - averageRmsOverVoltage: 'typing.Optional[int]' = None - averageRmsUnderVoltage: 'typing.Optional[int]' = None - rmsExtremeOverVoltage: 'typing.Optional[int]' = None - rmsExtremeUnderVoltage: 'typing.Optional[int]' = None - rmsVoltageSag: 'typing.Optional[int]' = None - rmsVoltageSwell: 'typing.Optional[int]' = None - lineCurrentPhaseB: 'typing.Optional[uint]' = None - activeCurrentPhaseB: 'typing.Optional[int]' = None - reactiveCurrentPhaseB: 'typing.Optional[int]' = None - rmsVoltagePhaseB: 'typing.Optional[uint]' = None - rmsVoltageMinPhaseB: 'typing.Optional[uint]' = None - rmsVoltageMaxPhaseB: 'typing.Optional[uint]' = None - rmsCurrentPhaseB: 'typing.Optional[uint]' = None - rmsCurrentMinPhaseB: 'typing.Optional[uint]' = None - rmsCurrentMaxPhaseB: 'typing.Optional[uint]' = None - activePowerPhaseB: 'typing.Optional[int]' = None - activePowerMinPhaseB: 'typing.Optional[int]' = None - activePowerMaxPhaseB: 'typing.Optional[int]' = None - reactivePowerPhaseB: 'typing.Optional[int]' = None - apparentPowerPhaseB: 'typing.Optional[uint]' = None - powerFactorPhaseB: 'typing.Optional[int]' = None - averageRmsVoltageMeasurementPeriodPhaseB: 'typing.Optional[uint]' = None - averageRmsOverVoltageCounterPhaseB: 'typing.Optional[uint]' = None - averageRmsUnderVoltageCounterPhaseB: 'typing.Optional[uint]' = None - rmsExtremeOverVoltagePeriodPhaseB: 'typing.Optional[uint]' = None - rmsExtremeUnderVoltagePeriodPhaseB: 'typing.Optional[uint]' = None - rmsVoltageSagPeriodPhaseB: 'typing.Optional[uint]' = None - rmsVoltageSwellPeriodPhaseB: 'typing.Optional[uint]' = None - lineCurrentPhaseC: 'typing.Optional[uint]' = None - activeCurrentPhaseC: 'typing.Optional[int]' = None - reactiveCurrentPhaseC: 'typing.Optional[int]' = None - rmsVoltagePhaseC: 'typing.Optional[uint]' = None - rmsVoltageMinPhaseC: 'typing.Optional[uint]' = None - rmsVoltageMaxPhaseC: 'typing.Optional[uint]' = None - rmsCurrentPhaseC: 'typing.Optional[uint]' = None - rmsCurrentMinPhaseC: 'typing.Optional[uint]' = None - rmsCurrentMaxPhaseC: 'typing.Optional[uint]' = None - activePowerPhaseC: 'typing.Optional[int]' = None - activePowerMinPhaseC: 'typing.Optional[int]' = None - activePowerMaxPhaseC: 'typing.Optional[int]' = None - reactivePowerPhaseC: 'typing.Optional[int]' = None - apparentPowerPhaseC: 'typing.Optional[uint]' = None - powerFactorPhaseC: 'typing.Optional[int]' = None - averageRmsVoltageMeasurementPeriodPhaseC: 'typing.Optional[uint]' = None - averageRmsOverVoltageCounterPhaseC: 'typing.Optional[uint]' = None - averageRmsUnderVoltageCounterPhaseC: 'typing.Optional[uint]' = None - rmsExtremeOverVoltagePeriodPhaseC: 'typing.Optional[uint]' = None - rmsExtremeUnderVoltagePeriodPhaseC: 'typing.Optional[uint]' = None - rmsVoltageSagPeriodPhaseC: 'typing.Optional[uint]' = None - rmsVoltageSwellPeriodPhaseC: 'typing.Optional[uint]' = None - generatedCommandList: 'typing.List[uint]' = None - acceptedCommandList: 'typing.List[uint]' = None - eventList: 'typing.List[uint]' = None - attributeList: 'typing.List[uint]' = None - featureMap: 'uint' = None - clusterRevision: 'uint' = None - - class Commands: - @dataclass - class GetProfileInfoResponseCommand(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000B04 - command_id: typing.ClassVar[int] = 0x00000000 - is_client: typing.ClassVar[bool] = False - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="profileCount", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="profileIntervalPeriod", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="maxNumberOfIntervals", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="listOfAttributes", Tag=3, Type=typing.List[uint]), - ]) - - profileCount: 'uint' = 0 - profileIntervalPeriod: 'uint' = 0 - maxNumberOfIntervals: 'uint' = 0 - listOfAttributes: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class GetProfileInfoCommand(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000B04 - command_id: typing.ClassVar[int] = 0x00000000 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ]) - - @dataclass - class GetMeasurementProfileResponseCommand(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000B04 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = False - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="startTime", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="status", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="profileIntervalPeriod", Tag=2, Type=uint), - ClusterObjectFieldDescriptor(Label="numberOfIntervalsDelivered", Tag=3, Type=uint), - ClusterObjectFieldDescriptor(Label="attributeId", Tag=4, Type=uint), - ClusterObjectFieldDescriptor(Label="intervals", Tag=5, Type=typing.List[uint]), - ]) - - startTime: 'uint' = 0 - status: 'uint' = 0 - profileIntervalPeriod: 'uint' = 0 - numberOfIntervalsDelivered: 'uint' = 0 - attributeId: 'uint' = 0 - intervals: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class GetMeasurementProfileCommand(ClusterCommand): - cluster_id: typing.ClassVar[int] = 0x00000B04 - command_id: typing.ClassVar[int] = 0x00000001 - is_client: typing.ClassVar[bool] = True - response_type: typing.ClassVar[str] = None - - @ChipUtility.classproperty - def descriptor(cls) -> ClusterObjectDescriptor: - return ClusterObjectDescriptor( - Fields=[ - ClusterObjectFieldDescriptor(Label="attributeId", Tag=0, Type=uint), - ClusterObjectFieldDescriptor(Label="startTime", Tag=1, Type=uint), - ClusterObjectFieldDescriptor(Label="numberOfIntervals", Tag=2, Type=uint), - ]) - - attributeId: 'uint' = 0 - startTime: 'uint' = 0 - numberOfIntervals: 'uint' = 0 - - class Attributes: - @dataclass - class MeasurementType(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000000 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class DcVoltage(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000100 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class DcVoltageMin(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000101 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class DcVoltageMax(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000102 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class DcCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000103 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class DcCurrentMin(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000104 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class DcCurrentMax(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000105 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class DcPower(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000106 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class DcPowerMin(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000107 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class DcPowerMax(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000108 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class DcVoltageMultiplier(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000200 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class DcVoltageDivisor(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000201 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class DcCurrentMultiplier(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000202 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class DcCurrentDivisor(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000203 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class DcPowerMultiplier(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000204 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class DcPowerDivisor(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000205 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AcFrequency(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000300 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AcFrequencyMin(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000301 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AcFrequencyMax(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000302 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class NeutralCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000303 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class TotalActivePower(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000304 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class TotalReactivePower(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000305 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class TotalApparentPower(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000306 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class Measured1stHarmonicCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000307 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class Measured3rdHarmonicCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000308 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class Measured5thHarmonicCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000309 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class Measured7thHarmonicCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000030A - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class Measured9thHarmonicCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000030B - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class Measured11thHarmonicCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000030C - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class MeasuredPhase1stHarmonicCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000030D - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class MeasuredPhase3rdHarmonicCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000030E - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class MeasuredPhase5thHarmonicCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000030F - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class MeasuredPhase7thHarmonicCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000310 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class MeasuredPhase9thHarmonicCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000311 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class MeasuredPhase11thHarmonicCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000312 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class AcFrequencyMultiplier(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000400 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AcFrequencyDivisor(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000401 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class PowerMultiplier(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000402 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class PowerDivisor(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000403 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class HarmonicCurrentMultiplier(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000404 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class PhaseHarmonicCurrentMultiplier(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000405 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class InstantaneousVoltage(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000500 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class InstantaneousLineCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000501 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class InstantaneousActiveCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000502 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class InstantaneousReactiveCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000503 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class InstantaneousPower(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000504 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class RmsVoltage(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000505 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsVoltageMin(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000506 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsVoltageMax(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000507 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsCurrent(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000508 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsCurrentMin(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000509 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsCurrentMax(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000050A - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class ActivePower(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000050B - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class ActivePowerMin(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000050C - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class ActivePowerMax(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000050D - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class ReactivePower(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000050E - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class ApparentPower(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000050F - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class PowerFactor(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000510 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class AverageRmsVoltageMeasurementPeriod(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000511 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AverageRmsUnderVoltageCounter(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000513 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsExtremeOverVoltagePeriod(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000514 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsExtremeUnderVoltagePeriod(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000515 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsVoltageSagPeriod(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000516 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsVoltageSwellPeriod(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000517 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AcVoltageMultiplier(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000600 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AcVoltageDivisor(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000601 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AcCurrentMultiplier(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000602 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AcCurrentDivisor(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000603 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AcPowerMultiplier(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000604 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AcPowerDivisor(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000605 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class OverloadAlarmsMask(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000700 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class VoltageOverload(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000701 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class CurrentOverload(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000702 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class AcOverloadAlarmsMask(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000800 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AcVoltageOverload(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000801 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class AcCurrentOverload(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000802 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class AcActivePowerOverload(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000803 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class AcReactivePowerOverload(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000804 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class AverageRmsOverVoltage(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000805 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class AverageRmsUnderVoltage(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000806 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class RmsExtremeOverVoltage(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000807 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class RmsExtremeUnderVoltage(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000808 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class RmsVoltageSag(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000809 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class RmsVoltageSwell(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000080A - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class LineCurrentPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000901 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class ActiveCurrentPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000902 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class ReactiveCurrentPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000903 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class RmsVoltagePhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000905 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsVoltageMinPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000906 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsVoltageMaxPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000907 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsCurrentPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000908 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsCurrentMinPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000909 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsCurrentMaxPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000090A - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class ActivePowerPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000090B - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class ActivePowerMinPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000090C - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class ActivePowerMaxPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000090D - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class ReactivePowerPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000090E - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class ApparentPowerPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000090F - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class PowerFactorPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000910 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class AverageRmsVoltageMeasurementPeriodPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000911 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AverageRmsOverVoltageCounterPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000912 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AverageRmsUnderVoltageCounterPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000913 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsExtremeOverVoltagePeriodPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000914 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsExtremeUnderVoltagePeriodPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000915 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsVoltageSagPeriodPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000916 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsVoltageSwellPeriodPhaseB(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000917 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class LineCurrentPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A01 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class ActiveCurrentPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A02 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class ReactiveCurrentPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A03 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class RmsVoltagePhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A05 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsVoltageMinPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A06 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsVoltageMaxPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A07 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsCurrentPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A08 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsCurrentMinPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A09 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsCurrentMaxPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A0A - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class ActivePowerPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A0B - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class ActivePowerMinPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A0C - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class ActivePowerMaxPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A0D - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class ReactivePowerPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A0E - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class ApparentPowerPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A0F - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class PowerFactorPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A10 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[int]) - - value: 'typing.Optional[int]' = None - - @dataclass - class AverageRmsVoltageMeasurementPeriodPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A11 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AverageRmsOverVoltageCounterPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A12 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class AverageRmsUnderVoltageCounterPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A13 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsExtremeOverVoltagePeriodPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A14 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsExtremeUnderVoltagePeriodPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A15 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsVoltageSagPeriodPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A16 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class RmsVoltageSwellPeriodPhaseC(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x00000A17 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.Optional[uint]) - - value: 'typing.Optional[uint]' = None - - @dataclass - class GeneratedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF8 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AcceptedCommandList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFF9 - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class EventList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFA - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class AttributeList(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFB - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=typing.List[uint]) - - value: 'typing.List[uint]' = field(default_factory=lambda: []) - - @dataclass - class FeatureMap(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFC - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass - class ClusterRevision(ClusterAttributeDescriptor): - @ChipUtility.classproperty - def cluster_id(cls) -> int: - return 0x00000B04 - - @ChipUtility.classproperty - def attribute_id(cls) -> int: - return 0x0000FFFD - - @ChipUtility.classproperty - def attribute_type(cls) -> ClusterObjectFieldDescriptor: - return ClusterObjectFieldDescriptor(Type=uint) - - value: 'uint' = 0 - - @dataclass class UnitTesting(Cluster): id: typing.ClassVar[int] = 0xFFF1FC05 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 4088d638e85c98..4d9c6b9f545dd1 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 @@ -748,200 +748,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace OnOff -namespace OnOffSwitchConfiguration { -namespace Attributes { - -namespace SwitchType { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id), - EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -} // namespace SwitchType - -namespace SwitchActions { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id), - EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -} // namespace SwitchActions - -namespace FeatureMap { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - -namespace ClusterRevision { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::OnOffSwitchConfiguration::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace OnOffSwitchConfiguration - namespace LevelControl { namespace Attributes { @@ -1960,159 +1766,18 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace LevelControl -namespace BinaryInputBasic { +namespace PulseWidthModulation { namespace Attributes { -namespace ActiveText { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value) -{ - uint8_t zclString[16 + 1]; - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - - VerifyOrReturnError(value.size() == 16, Protocols::InteractionModel::Status::InvalidDataType); - memcpy(value.data(), &zclString[1], 16); - value.reduce_size(length); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) -{ - - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BinaryInputBasic::Id, Id), - EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value) -{ - - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -} // namespace ActiveText - -namespace Description { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value) -{ - uint8_t zclString[16 + 1]; - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - - VerifyOrReturnError(value.size() == 16, Protocols::InteractionModel::Status::InvalidDataType); - memcpy(value.data(), &zclString[1], 16); - value.reduce_size(length); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) -{ - - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BinaryInputBasic::Id, Id), - EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value) -{ - - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -} // namespace Description - -namespace InactiveText { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value) -{ - uint8_t zclString[16 + 1]; - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - - VerifyOrReturnError(value.size() == 16, Protocols::InteractionModel::Status::InvalidDataType); - memcpy(value.data(), &zclString[1], 16); - value.reduce_size(length); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) -{ - - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BinaryInputBasic::Id, Id), - EmberAfWriteDataInput(zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value) -{ - - static_assert(16 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 16, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[16 + 1]; - auto length = static_cast(value.size()); - Encoding::Put8(zclString, length); - memcpy(&zclString[1], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, zclString, ZCL_CHAR_STRING_ATTRIBUTE_TYPE); -} - -} // namespace InactiveText - -namespace OutOfService { +namespace FeatureMap { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -2122,9 +1787,9 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -2132,13 +1797,13 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAtt Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BinaryInputBasic::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::PulseWidthModulation::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -2146,20 +1811,20 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -} // namespace OutOfService +} // namespace FeatureMap -namespace Polarity { +namespace ClusterRevision { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -2169,9 +1834,9 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -2179,13 +1844,13 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, Mark Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BinaryInputBasic::Id, Id), - EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::PulseWidthModulation::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -2193,20 +1858,29 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace Polarity +} // namespace ClusterRevision + +} // namespace Attributes +} // namespace PulseWidthModulation -namespace PresentValue { +namespace Descriptor { +namespace Attributes {} // namespace Attributes +} // namespace Descriptor -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) +namespace Binding { +namespace Attributes { + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Binding::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -2216,9 +1890,9 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value) return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -2226,13 +1900,13 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAtt Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BinaryInputBasic::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Binding::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -2240,20 +1914,19 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_BOOLEAN_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Binding::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -} // namespace PresentValue +} // namespace FeatureMap -namespace Reliability { +namespace ClusterRevision { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Binding::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -2263,9 +1936,9 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -2273,13 +1946,13 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, Mark Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BinaryInputBasic::Id, Id), - EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Binding::Id, Id), + EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -2287,20 +1960,26 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Binding::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } -} // namespace Reliability +} // namespace ClusterRevision -namespace StatusFlags { +} // namespace Attributes +} // namespace Binding -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) +namespace AccessControl { +namespace Attributes { + +namespace FeatureMap { + +Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; Traits::StorageType temp; uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::AccessControl::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -2310,9 +1989,9 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -2320,13 +1999,13 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, Mark Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BinaryInputBasic::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::AccessControl::Id, Id), + EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) +Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) { - using Traits = NumericAttributeTraits; + using Traits = NumericAttributeTraits; if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) { return Protocols::InteractionModel::Status::ConstraintError; @@ -2334,57 +2013,63 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::AccessControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } -} // namespace StatusFlags +} // namespace FeatureMap + +} // namespace Attributes +} // namespace AccessControl + +namespace Actions { +namespace Attributes { -namespace ApplicationType { +namespace SetupURL { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) +Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value) { - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + uint8_t zclString[512 + 2]; Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::Actions::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) + size_t length = emberAfLongStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) { return Protocols::InteractionModel::Status::ConstraintError; } - *value = Traits::StorageToWorking(temp); + + VerifyOrReturnError(value.size() == 512, Protocols::InteractionModel::Status::InvalidDataType); + memcpy(value.data(), &zclString[2], 512); + value.reduce_size(length); return status; } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BinaryInputBasic::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); + + static_assert(512 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 512, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[512 + 2]; + auto length = static_cast(value.size()); + Encoding::LittleEndian::Put16(zclString, length); + memcpy(&zclString[2], value.data(), value.size()); + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Actions::Id, Id), + EmberAfWriteDataInput(zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) +Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value) { - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); + + static_assert(512 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); + VerifyOrReturnError(value.size() <= 512, Protocols::InteractionModel::Status::ConstraintError); + uint8_t zclString[512 + 2]; + auto length = static_cast(value.size()); + Encoding::LittleEndian::Put16(zclString, length); + memcpy(&zclString[2], value.data(), value.size()); + return emberAfWriteAttribute(endpoint, Clusters::Actions::Id, Id, zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE); } -} // namespace ApplicationType +} // namespace SetupURL namespace FeatureMap { @@ -2392,9 +2077,8 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Actions::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -2414,7 +2098,7 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, Mar Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BinaryInputBasic::Id, Id), + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Actions::Id, Id), EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } @@ -2428,7 +2112,7 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Actions::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); } } // namespace FeatureMap @@ -2439,9 +2123,8 @@ Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) { using Traits = NumericAttributeTraits; Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, readable, sizeof(temp)); + uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Actions::Id, Id, readable, sizeof(temp)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) { @@ -2461,7 +2144,7 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BinaryInputBasic::Id, Id), + return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Actions::Id, Id), EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); } @@ -2475,427 +2158,27 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) Traits::StorageType storageValue; Traits::WorkingToStorage(value, storageValue); uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BinaryInputBasic::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); + return emberAfWriteAttribute(endpoint, Clusters::Actions::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); } } // namespace ClusterRevision } // namespace Attributes -} // namespace BinaryInputBasic +} // namespace Actions -namespace PulseWidthModulation { +namespace BasicInformation { namespace Attributes { -namespace FeatureMap { +namespace NodeLabel { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) +Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value) { - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); + uint8_t zclString[32 + 1]; Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, readable, sizeof(temp)); + emberAfReadAttribute(endpoint, Clusters::BasicInformation::Id, Id, zclString, sizeof(zclString)); VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::PulseWidthModulation::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - -namespace ClusterRevision { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::PulseWidthModulation::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::PulseWidthModulation::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace PulseWidthModulation - -namespace Descriptor { -namespace Attributes {} // namespace Attributes -} // namespace Descriptor - -namespace Binding { -namespace Attributes { - -namespace FeatureMap { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Binding::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Binding::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Binding::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - -namespace ClusterRevision { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Binding::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Binding::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Binding::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace Binding - -namespace AccessControl { -namespace Attributes { - -namespace FeatureMap { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::AccessControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::AccessControl::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::AccessControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - -} // namespace Attributes -} // namespace AccessControl - -namespace Actions { -namespace Attributes { - -namespace SetupURL { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value) -{ - uint8_t zclString[512 + 2]; - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::Actions::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - size_t length = emberAfLongStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - - VerifyOrReturnError(value.size() == 512, Protocols::InteractionModel::Status::InvalidDataType); - memcpy(value.data(), &zclString[2], 512); - value.reduce_size(length); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty) -{ - - static_assert(512 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 512, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[512 + 2]; - auto length = static_cast(value.size()); - Encoding::LittleEndian::Put16(zclString, length); - memcpy(&zclString[2], value.data(), value.size()); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Actions::Id, Id), - EmberAfWriteDataInput(zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value) -{ - - static_assert(512 < NumericAttributeTraits::kNullValue, "value.size() might be too big"); - VerifyOrReturnError(value.size() <= 512, Protocols::InteractionModel::Status::ConstraintError); - uint8_t zclString[512 + 2]; - auto length = static_cast(value.size()); - Encoding::LittleEndian::Put16(zclString, length); - memcpy(&zclString[2], value.data(), value.size()); - return emberAfWriteAttribute(endpoint, Clusters::Actions::Id, Id, zclString, ZCL_LONG_CHAR_STRING_ATTRIBUTE_TYPE); -} - -} // namespace SetupURL - -namespace FeatureMap { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Actions::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Actions::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Actions::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - -namespace ClusterRevision { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = emberAfReadAttribute(endpoint, Clusters::Actions::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::Actions::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::Actions::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace Actions - -namespace BasicInformation { -namespace Attributes { - -namespace NodeLabel { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value) -{ - uint8_t zclString[32 + 1]; - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BasicInformation::Id, Id, zclString, sizeof(zclString)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - size_t length = emberAfStringLength(zclString); - if (length == NumericAttributeTraits::kNullValue) + size_t length = emberAfStringLength(zclString); + if (length == NumericAttributeTraits::kNullValue) { return Protocols::InteractionModel::Status::ConstraintError; } @@ -20270,576 +19553,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace WindowCovering -namespace BarrierControl { -namespace Attributes { - -namespace BarrierMovingState { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BarrierControl::Id, Id), - EmberAfWriteDataInput(writable, ZCL_ENUM8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_ENUM8_ATTRIBUTE_TYPE); -} - -} // namespace BarrierMovingState - -namespace BarrierSafetyStatus { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BarrierControl::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BITMAP16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); -} - -} // namespace BarrierSafetyStatus - -namespace BarrierCapabilities { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BarrierControl::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); -} - -} // namespace BarrierCapabilities - -namespace BarrierOpenEvents { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BarrierControl::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace BarrierOpenEvents - -namespace BarrierCloseEvents { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BarrierControl::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace BarrierCloseEvents - -namespace BarrierCommandOpenEvents { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BarrierControl::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace BarrierCommandOpenEvents - -namespace BarrierCommandCloseEvents { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BarrierControl::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace BarrierCommandCloseEvents - -namespace BarrierOpenPeriod { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BarrierControl::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace BarrierOpenPeriod - -namespace BarrierClosePeriod { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BarrierControl::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace BarrierClosePeriod - -namespace BarrierPosition { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BarrierControl::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT8U_ATTRIBUTE_TYPE); -} - -} // namespace BarrierPosition - -namespace FeatureMap { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BarrierControl::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - -namespace ClusterRevision { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::BarrierControl::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::BarrierControl::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::BarrierControl::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace BarrierControl - namespace ServiceArea { namespace Attributes { @@ -38205,6122 +36918,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) } // namespace Attributes } // namespace CommissionerControl -namespace ElectricalMeasurement { -namespace Attributes { - -namespace MeasurementType { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace MeasurementType - -namespace DcVoltage { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace DcVoltage - -namespace DcVoltageMin { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace DcVoltageMin - -namespace DcVoltageMax { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace DcVoltageMax - -namespace DcCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace DcCurrent - -namespace DcCurrentMin { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace DcCurrentMin - -namespace DcCurrentMax { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace DcCurrentMax - -namespace DcPower { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace DcPower - -namespace DcPowerMin { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace DcPowerMin - -namespace DcPowerMax { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace DcPowerMax - -namespace DcVoltageMultiplier { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace DcVoltageMultiplier - -namespace DcVoltageDivisor { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace DcVoltageDivisor - -namespace DcCurrentMultiplier { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace DcCurrentMultiplier - -namespace DcCurrentDivisor { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace DcCurrentDivisor - -namespace DcPowerMultiplier { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace DcPowerMultiplier - -namespace DcPowerDivisor { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace DcPowerDivisor - -namespace AcFrequency { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AcFrequency - -namespace AcFrequencyMin { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AcFrequencyMin - -namespace AcFrequencyMax { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AcFrequencyMax - -namespace NeutralCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace NeutralCurrent - -namespace TotalActivePower { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT32S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); -} - -} // namespace TotalActivePower - -namespace TotalReactivePower { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT32S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32S_ATTRIBUTE_TYPE); -} - -} // namespace TotalReactivePower - -namespace TotalApparentPower { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); -} - -} // namespace TotalApparentPower - -namespace Measured1stHarmonicCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace Measured1stHarmonicCurrent - -namespace Measured3rdHarmonicCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace Measured3rdHarmonicCurrent - -namespace Measured5thHarmonicCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace Measured5thHarmonicCurrent - -namespace Measured7thHarmonicCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace Measured7thHarmonicCurrent - -namespace Measured9thHarmonicCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace Measured9thHarmonicCurrent - -namespace Measured11thHarmonicCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace Measured11thHarmonicCurrent - -namespace MeasuredPhase1stHarmonicCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace MeasuredPhase1stHarmonicCurrent - -namespace MeasuredPhase3rdHarmonicCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace MeasuredPhase3rdHarmonicCurrent - -namespace MeasuredPhase5thHarmonicCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace MeasuredPhase5thHarmonicCurrent - -namespace MeasuredPhase7thHarmonicCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace MeasuredPhase7thHarmonicCurrent - -namespace MeasuredPhase9thHarmonicCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace MeasuredPhase9thHarmonicCurrent - -namespace MeasuredPhase11thHarmonicCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace MeasuredPhase11thHarmonicCurrent - -namespace AcFrequencyMultiplier { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AcFrequencyMultiplier - -namespace AcFrequencyDivisor { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AcFrequencyDivisor - -namespace PowerMultiplier { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); -} - -} // namespace PowerMultiplier - -namespace PowerDivisor { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT32U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT32U_ATTRIBUTE_TYPE); -} - -} // namespace PowerDivisor - -namespace HarmonicCurrentMultiplier { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); -} - -} // namespace HarmonicCurrentMultiplier - -namespace PhaseHarmonicCurrentMultiplier { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); -} - -} // namespace PhaseHarmonicCurrentMultiplier - -namespace InstantaneousVoltage { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace InstantaneousVoltage - -namespace InstantaneousLineCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace InstantaneousLineCurrent - -namespace InstantaneousActiveCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace InstantaneousActiveCurrent - -namespace InstantaneousReactiveCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace InstantaneousReactiveCurrent - -namespace InstantaneousPower { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace InstantaneousPower - -namespace RmsVoltage { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltage - -namespace RmsVoltageMin { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltageMin - -namespace RmsVoltageMax { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltageMax - -namespace RmsCurrent { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsCurrent - -namespace RmsCurrentMin { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsCurrentMin - -namespace RmsCurrentMax { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsCurrentMax - -namespace ActivePower { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ActivePower - -namespace ActivePowerMin { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ActivePowerMin - -namespace ActivePowerMax { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ActivePowerMax - -namespace ReactivePower { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ReactivePower - -namespace ApparentPower { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ApparentPower - -namespace PowerFactor { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); -} - -} // namespace PowerFactor - -namespace AverageRmsVoltageMeasurementPeriod { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AverageRmsVoltageMeasurementPeriod - -namespace AverageRmsUnderVoltageCounter { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AverageRmsUnderVoltageCounter - -namespace RmsExtremeOverVoltagePeriod { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsExtremeOverVoltagePeriod - -namespace RmsExtremeUnderVoltagePeriod { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsExtremeUnderVoltagePeriod - -namespace RmsVoltageSagPeriod { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltageSagPeriod - -namespace RmsVoltageSwellPeriod { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltageSwellPeriod - -namespace AcVoltageMultiplier { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AcVoltageMultiplier - -namespace AcVoltageDivisor { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AcVoltageDivisor - -namespace AcCurrentMultiplier { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AcCurrentMultiplier - -namespace AcCurrentDivisor { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AcCurrentDivisor - -namespace AcPowerMultiplier { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AcPowerMultiplier - -namespace AcPowerDivisor { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AcPowerDivisor - -namespace OverloadAlarmsMask { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BITMAP8_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP8_ATTRIBUTE_TYPE); -} - -} // namespace OverloadAlarmsMask - -namespace VoltageOverload { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace VoltageOverload - -namespace CurrentOverload { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace CurrentOverload - -namespace AcOverloadAlarmsMask { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BITMAP16_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP16_ATTRIBUTE_TYPE); -} - -} // namespace AcOverloadAlarmsMask - -namespace AcVoltageOverload { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace AcVoltageOverload - -namespace AcCurrentOverload { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace AcCurrentOverload - -namespace AcActivePowerOverload { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace AcActivePowerOverload - -namespace AcReactivePowerOverload { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace AcReactivePowerOverload - -namespace AverageRmsOverVoltage { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace AverageRmsOverVoltage - -namespace AverageRmsUnderVoltage { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace AverageRmsUnderVoltage - -namespace RmsExtremeOverVoltage { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace RmsExtremeOverVoltage - -namespace RmsExtremeUnderVoltage { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace RmsExtremeUnderVoltage - -namespace RmsVoltageSag { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltageSag - -namespace RmsVoltageSwell { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltageSwell - -namespace LineCurrentPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace LineCurrentPhaseB - -namespace ActiveCurrentPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ActiveCurrentPhaseB - -namespace ReactiveCurrentPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ReactiveCurrentPhaseB - -namespace RmsVoltagePhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltagePhaseB - -namespace RmsVoltageMinPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltageMinPhaseB - -namespace RmsVoltageMaxPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltageMaxPhaseB - -namespace RmsCurrentPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsCurrentPhaseB - -namespace RmsCurrentMinPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsCurrentMinPhaseB - -namespace RmsCurrentMaxPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsCurrentMaxPhaseB - -namespace ActivePowerPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ActivePowerPhaseB - -namespace ActivePowerMinPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ActivePowerMinPhaseB - -namespace ActivePowerMaxPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ActivePowerMaxPhaseB - -namespace ReactivePowerPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ReactivePowerPhaseB - -namespace ApparentPowerPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ApparentPowerPhaseB - -namespace PowerFactorPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); -} - -} // namespace PowerFactorPhaseB - -namespace AverageRmsVoltageMeasurementPeriodPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AverageRmsVoltageMeasurementPeriodPhaseB - -namespace AverageRmsOverVoltageCounterPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AverageRmsOverVoltageCounterPhaseB - -namespace AverageRmsUnderVoltageCounterPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AverageRmsUnderVoltageCounterPhaseB - -namespace RmsExtremeOverVoltagePeriodPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsExtremeOverVoltagePeriodPhaseB - -namespace RmsExtremeUnderVoltagePeriodPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsExtremeUnderVoltagePeriodPhaseB - -namespace RmsVoltageSagPeriodPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltageSagPeriodPhaseB - -namespace RmsVoltageSwellPeriodPhaseB { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltageSwellPeriodPhaseB - -namespace LineCurrentPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace LineCurrentPhaseC - -namespace ActiveCurrentPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ActiveCurrentPhaseC - -namespace ReactiveCurrentPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ReactiveCurrentPhaseC - -namespace RmsVoltagePhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltagePhaseC - -namespace RmsVoltageMinPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltageMinPhaseC - -namespace RmsVoltageMaxPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltageMaxPhaseC - -namespace RmsCurrentPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsCurrentPhaseC - -namespace RmsCurrentMinPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsCurrentMinPhaseC - -namespace RmsCurrentMaxPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsCurrentMaxPhaseC - -namespace ActivePowerPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ActivePowerPhaseC - -namespace ActivePowerMinPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ActivePowerMinPhaseC - -namespace ActivePowerMaxPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ActivePowerMaxPhaseC - -namespace ReactivePowerPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16S_ATTRIBUTE_TYPE); -} - -} // namespace ReactivePowerPhaseC - -namespace ApparentPowerPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ApparentPowerPhaseC - -namespace PowerFactorPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, int8_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT8S_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT8S_ATTRIBUTE_TYPE); -} - -} // namespace PowerFactorPhaseC - -namespace AverageRmsVoltageMeasurementPeriodPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AverageRmsVoltageMeasurementPeriodPhaseC - -namespace AverageRmsOverVoltageCounterPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AverageRmsOverVoltageCounterPhaseC - -namespace AverageRmsUnderVoltageCounterPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace AverageRmsUnderVoltageCounterPhaseC - -namespace RmsExtremeOverVoltagePeriodPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsExtremeOverVoltagePeriodPhaseC - -namespace RmsExtremeUnderVoltagePeriodPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsExtremeUnderVoltagePeriodPhaseC - -namespace RmsVoltageSagPeriodPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltageSagPeriodPhaseC - -namespace RmsVoltageSwellPeriodPhaseC { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace RmsVoltageSwellPeriodPhaseC - -namespace FeatureMap { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_BITMAP32_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_BITMAP32_ATTRIBUTE_TYPE); -} - -} // namespace FeatureMap - -namespace ClusterRevision { - -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value) -{ - using Traits = NumericAttributeTraits; - Traits::StorageType temp; - uint8_t * readable = Traits::ToAttributeStoreRepresentation(temp); - Protocols::InteractionModel::Status status = - emberAfReadAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, readable, sizeof(temp)); - VerifyOrReturnError(Protocols::InteractionModel::Status::Success == status, status); - if (!Traits::CanRepresentValue(/* isNullable = */ false, temp)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - *value = Traits::StorageToWorking(temp); - return status; -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(ConcreteAttributePath(endpoint, Clusters::ElectricalMeasurement::Id, Id), - EmberAfWriteDataInput(writable, ZCL_INT16U_ATTRIBUTE_TYPE).SetMarkDirty(markDirty)); -} - -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value) -{ - using Traits = NumericAttributeTraits; - if (!Traits::CanRepresentValue(/* isNullable = */ false, value)) - { - return Protocols::InteractionModel::Status::ConstraintError; - } - Traits::StorageType storageValue; - Traits::WorkingToStorage(value, storageValue); - uint8_t * writable = Traits::ToAttributeStoreRepresentation(storageValue); - return emberAfWriteAttribute(endpoint, Clusters::ElectricalMeasurement::Id, Id, writable, ZCL_INT16U_ATTRIBUTE_TYPE); -} - -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace ElectricalMeasurement - namespace UnitTesting { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h b/zzz_generated/app-common/app-common/zap-generated/attributes/Accessors.h index f44307d55e9ae1..c4b83e7920c064 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 @@ -151,36 +151,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar } // namespace Attributes } // namespace OnOff -namespace OnOffSwitchConfiguration { -namespace Attributes { - -namespace SwitchType { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // enum8 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace SwitchType - -namespace SwitchActions { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // enum8 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace SwitchActions - -namespace FeatureMap { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); -} // namespace FeatureMap - -namespace ClusterRevision { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace OnOffSwitchConfiguration - namespace LevelControl { namespace Attributes { @@ -315,78 +285,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar } // namespace Attributes } // namespace LevelControl -namespace BinaryInputBasic { -namespace Attributes { - -namespace ActiveText { -Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value); // char_string -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty); -} // namespace ActiveText - -namespace Description { -Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value); // char_string -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty); -} // namespace Description - -namespace InactiveText { -Protocols::InteractionModel::Status Get(EndpointId endpoint, chip::MutableCharSpan & value); // char_string -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, chip::CharSpan value, MarkAttributeDirty markDirty); -} // namespace InactiveText - -namespace OutOfService { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace OutOfService - -namespace Polarity { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // enum8 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace Polarity - -namespace PresentValue { -Protocols::InteractionModel::Status Get(EndpointId endpoint, bool * value); // boolean -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, bool value, MarkAttributeDirty markDirty); -} // namespace PresentValue - -namespace Reliability { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // enum8 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace Reliability - -namespace StatusFlags { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // bitmap8 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace StatusFlags - -namespace ApplicationType { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // int32u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); -} // namespace ApplicationType - -namespace FeatureMap { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); -} // namespace FeatureMap - -namespace ClusterRevision { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace BinaryInputBasic - namespace PulseWidthModulation { namespace Attributes { @@ -3186,84 +3084,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar } // namespace Attributes } // namespace WindowCovering -namespace BarrierControl { -namespace Attributes { - -namespace BarrierMovingState { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // enum8 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace BarrierMovingState - -namespace BarrierSafetyStatus { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // bitmap16 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace BarrierSafetyStatus - -namespace BarrierCapabilities { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // bitmap8 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace BarrierCapabilities - -namespace BarrierOpenEvents { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace BarrierOpenEvents - -namespace BarrierCloseEvents { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace BarrierCloseEvents - -namespace BarrierCommandOpenEvents { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace BarrierCommandOpenEvents - -namespace BarrierCommandCloseEvents { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace BarrierCommandCloseEvents - -namespace BarrierOpenPeriod { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace BarrierOpenPeriod - -namespace BarrierClosePeriod { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace BarrierClosePeriod - -namespace BarrierPosition { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // int8u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace BarrierPosition - -namespace FeatureMap { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); -} // namespace FeatureMap - -namespace ClusterRevision { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace BarrierControl - namespace ServiceArea { namespace Attributes { @@ -5790,792 +5610,6 @@ Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, Mar } // namespace Attributes } // namespace CommissionerControl -namespace ElectricalMeasurement { -namespace Attributes { - -namespace MeasurementType { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); -} // namespace MeasurementType - -namespace DcVoltage { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace DcVoltage - -namespace DcVoltageMin { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace DcVoltageMin - -namespace DcVoltageMax { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace DcVoltageMax - -namespace DcCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace DcCurrent - -namespace DcCurrentMin { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace DcCurrentMin - -namespace DcCurrentMax { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace DcCurrentMax - -namespace DcPower { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace DcPower - -namespace DcPowerMin { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace DcPowerMin - -namespace DcPowerMax { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace DcPowerMax - -namespace DcVoltageMultiplier { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace DcVoltageMultiplier - -namespace DcVoltageDivisor { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace DcVoltageDivisor - -namespace DcCurrentMultiplier { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace DcCurrentMultiplier - -namespace DcCurrentDivisor { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace DcCurrentDivisor - -namespace DcPowerMultiplier { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace DcPowerMultiplier - -namespace DcPowerDivisor { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace DcPowerDivisor - -namespace AcFrequency { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AcFrequency - -namespace AcFrequencyMin { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AcFrequencyMin - -namespace AcFrequencyMax { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AcFrequencyMax - -namespace NeutralCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace NeutralCurrent - -namespace TotalActivePower { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int32_t * value); // int32s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value, MarkAttributeDirty markDirty); -} // namespace TotalActivePower - -namespace TotalReactivePower { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int32_t * value); // int32s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int32_t value, MarkAttributeDirty markDirty); -} // namespace TotalReactivePower - -namespace TotalApparentPower { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // int32u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); -} // namespace TotalApparentPower - -namespace Measured1stHarmonicCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace Measured1stHarmonicCurrent - -namespace Measured3rdHarmonicCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace Measured3rdHarmonicCurrent - -namespace Measured5thHarmonicCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace Measured5thHarmonicCurrent - -namespace Measured7thHarmonicCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace Measured7thHarmonicCurrent - -namespace Measured9thHarmonicCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace Measured9thHarmonicCurrent - -namespace Measured11thHarmonicCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace Measured11thHarmonicCurrent - -namespace MeasuredPhase1stHarmonicCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace MeasuredPhase1stHarmonicCurrent - -namespace MeasuredPhase3rdHarmonicCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace MeasuredPhase3rdHarmonicCurrent - -namespace MeasuredPhase5thHarmonicCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace MeasuredPhase5thHarmonicCurrent - -namespace MeasuredPhase7thHarmonicCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace MeasuredPhase7thHarmonicCurrent - -namespace MeasuredPhase9thHarmonicCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace MeasuredPhase9thHarmonicCurrent - -namespace MeasuredPhase11thHarmonicCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace MeasuredPhase11thHarmonicCurrent - -namespace AcFrequencyMultiplier { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AcFrequencyMultiplier - -namespace AcFrequencyDivisor { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AcFrequencyDivisor - -namespace PowerMultiplier { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // int32u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); -} // namespace PowerMultiplier - -namespace PowerDivisor { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // int32u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); -} // namespace PowerDivisor - -namespace HarmonicCurrentMultiplier { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int8_t * value); // int8s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty); -} // namespace HarmonicCurrentMultiplier - -namespace PhaseHarmonicCurrentMultiplier { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int8_t * value); // int8s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty); -} // namespace PhaseHarmonicCurrentMultiplier - -namespace InstantaneousVoltage { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace InstantaneousVoltage - -namespace InstantaneousLineCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace InstantaneousLineCurrent - -namespace InstantaneousActiveCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace InstantaneousActiveCurrent - -namespace InstantaneousReactiveCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace InstantaneousReactiveCurrent - -namespace InstantaneousPower { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace InstantaneousPower - -namespace RmsVoltage { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltage - -namespace RmsVoltageMin { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltageMin - -namespace RmsVoltageMax { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltageMax - -namespace RmsCurrent { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsCurrent - -namespace RmsCurrentMin { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsCurrentMin - -namespace RmsCurrentMax { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsCurrentMax - -namespace ActivePower { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ActivePower - -namespace ActivePowerMin { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ActivePowerMin - -namespace ActivePowerMax { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ActivePowerMax - -namespace ReactivePower { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ReactivePower - -namespace ApparentPower { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace ApparentPower - -namespace PowerFactor { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int8_t * value); // int8s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty); -} // namespace PowerFactor - -namespace AverageRmsVoltageMeasurementPeriod { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AverageRmsVoltageMeasurementPeriod - -namespace AverageRmsUnderVoltageCounter { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AverageRmsUnderVoltageCounter - -namespace RmsExtremeOverVoltagePeriod { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsExtremeOverVoltagePeriod - -namespace RmsExtremeUnderVoltagePeriod { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsExtremeUnderVoltagePeriod - -namespace RmsVoltageSagPeriod { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltageSagPeriod - -namespace RmsVoltageSwellPeriod { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltageSwellPeriod - -namespace AcVoltageMultiplier { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AcVoltageMultiplier - -namespace AcVoltageDivisor { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AcVoltageDivisor - -namespace AcCurrentMultiplier { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AcCurrentMultiplier - -namespace AcCurrentDivisor { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AcCurrentDivisor - -namespace AcPowerMultiplier { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AcPowerMultiplier - -namespace AcPowerDivisor { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AcPowerDivisor - -namespace OverloadAlarmsMask { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint8_t * value); // bitmap8 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint8_t value, MarkAttributeDirty markDirty); -} // namespace OverloadAlarmsMask - -namespace VoltageOverload { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace VoltageOverload - -namespace CurrentOverload { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace CurrentOverload - -namespace AcOverloadAlarmsMask { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // bitmap16 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AcOverloadAlarmsMask - -namespace AcVoltageOverload { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace AcVoltageOverload - -namespace AcCurrentOverload { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace AcCurrentOverload - -namespace AcActivePowerOverload { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace AcActivePowerOverload - -namespace AcReactivePowerOverload { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace AcReactivePowerOverload - -namespace AverageRmsOverVoltage { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace AverageRmsOverVoltage - -namespace AverageRmsUnderVoltage { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace AverageRmsUnderVoltage - -namespace RmsExtremeOverVoltage { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace RmsExtremeOverVoltage - -namespace RmsExtremeUnderVoltage { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace RmsExtremeUnderVoltage - -namespace RmsVoltageSag { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltageSag - -namespace RmsVoltageSwell { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltageSwell - -namespace LineCurrentPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace LineCurrentPhaseB - -namespace ActiveCurrentPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ActiveCurrentPhaseB - -namespace ReactiveCurrentPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ReactiveCurrentPhaseB - -namespace RmsVoltagePhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltagePhaseB - -namespace RmsVoltageMinPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltageMinPhaseB - -namespace RmsVoltageMaxPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltageMaxPhaseB - -namespace RmsCurrentPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsCurrentPhaseB - -namespace RmsCurrentMinPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsCurrentMinPhaseB - -namespace RmsCurrentMaxPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsCurrentMaxPhaseB - -namespace ActivePowerPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ActivePowerPhaseB - -namespace ActivePowerMinPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ActivePowerMinPhaseB - -namespace ActivePowerMaxPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ActivePowerMaxPhaseB - -namespace ReactivePowerPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ReactivePowerPhaseB - -namespace ApparentPowerPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace ApparentPowerPhaseB - -namespace PowerFactorPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int8_t * value); // int8s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty); -} // namespace PowerFactorPhaseB - -namespace AverageRmsVoltageMeasurementPeriodPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AverageRmsVoltageMeasurementPeriodPhaseB - -namespace AverageRmsOverVoltageCounterPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AverageRmsOverVoltageCounterPhaseB - -namespace AverageRmsUnderVoltageCounterPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AverageRmsUnderVoltageCounterPhaseB - -namespace RmsExtremeOverVoltagePeriodPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsExtremeOverVoltagePeriodPhaseB - -namespace RmsExtremeUnderVoltagePeriodPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsExtremeUnderVoltagePeriodPhaseB - -namespace RmsVoltageSagPeriodPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltageSagPeriodPhaseB - -namespace RmsVoltageSwellPeriodPhaseB { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltageSwellPeriodPhaseB - -namespace LineCurrentPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace LineCurrentPhaseC - -namespace ActiveCurrentPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ActiveCurrentPhaseC - -namespace ReactiveCurrentPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ReactiveCurrentPhaseC - -namespace RmsVoltagePhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltagePhaseC - -namespace RmsVoltageMinPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltageMinPhaseC - -namespace RmsVoltageMaxPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltageMaxPhaseC - -namespace RmsCurrentPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsCurrentPhaseC - -namespace RmsCurrentMinPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsCurrentMinPhaseC - -namespace RmsCurrentMaxPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsCurrentMaxPhaseC - -namespace ActivePowerPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ActivePowerPhaseC - -namespace ActivePowerMinPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ActivePowerMinPhaseC - -namespace ActivePowerMaxPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ActivePowerMaxPhaseC - -namespace ReactivePowerPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int16_t * value); // int16s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int16_t value, MarkAttributeDirty markDirty); -} // namespace ReactivePowerPhaseC - -namespace ApparentPowerPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace ApparentPowerPhaseC - -namespace PowerFactorPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, int8_t * value); // int8s -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, int8_t value, MarkAttributeDirty markDirty); -} // namespace PowerFactorPhaseC - -namespace AverageRmsVoltageMeasurementPeriodPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AverageRmsVoltageMeasurementPeriodPhaseC - -namespace AverageRmsOverVoltageCounterPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AverageRmsOverVoltageCounterPhaseC - -namespace AverageRmsUnderVoltageCounterPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace AverageRmsUnderVoltageCounterPhaseC - -namespace RmsExtremeOverVoltagePeriodPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsExtremeOverVoltagePeriodPhaseC - -namespace RmsExtremeUnderVoltagePeriodPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsExtremeUnderVoltagePeriodPhaseC - -namespace RmsVoltageSagPeriodPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltageSagPeriodPhaseC - -namespace RmsVoltageSwellPeriodPhaseC { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace RmsVoltageSwellPeriodPhaseC - -namespace FeatureMap { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint32_t * value); // bitmap32 -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint32_t value, MarkAttributeDirty markDirty); -} // namespace FeatureMap - -namespace ClusterRevision { -Protocols::InteractionModel::Status Get(EndpointId endpoint, uint16_t * value); // int16u -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value); -Protocols::InteractionModel::Status Set(EndpointId endpoint, uint16_t value, MarkAttributeDirty markDirty); -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace ElectricalMeasurement - namespace UnitTesting { 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 724e7a7eb88857..7e86e92268f703 100644 --- a/zzz_generated/app-common/app-common/zap-generated/callback.h +++ b/zzz_generated/app-common/app-common/zap-generated/callback.h @@ -48,21 +48,11 @@ void emberAfGroupsClusterInitCallback(chip::EndpointId endpoint); */ void emberAfOnOffClusterInitCallback(chip::EndpointId endpoint); -/** - * @param endpoint Endpoint that is being initialized - */ -void emberAfOnOffSwitchConfigurationClusterInitCallback(chip::EndpointId endpoint); - /** * @param endpoint Endpoint that is being initialized */ void emberAfLevelControlClusterInitCallback(chip::EndpointId endpoint); -/** - * @param endpoint Endpoint that is being initialized - */ -void emberAfBinaryInputBasicClusterInitCallback(chip::EndpointId endpoint); - /** * @param endpoint Endpoint that is being initialized */ @@ -428,11 +418,6 @@ void emberAfDoorLockClusterInitCallback(chip::EndpointId endpoint); */ void emberAfWindowCoveringClusterInitCallback(chip::EndpointId endpoint); -/** - * @param endpoint Endpoint that is being initialized - */ -void emberAfBarrierControlClusterInitCallback(chip::EndpointId endpoint); - /** * @param endpoint Endpoint that is being initialized */ @@ -643,11 +628,6 @@ void emberAfEcosystemInformationClusterInitCallback(chip::EndpointId endpoint); */ void emberAfCommissionerControlClusterInitCallback(chip::EndpointId endpoint); -/** - * @param endpoint Endpoint that is being initialized - */ -void emberAfElectricalMeasurementClusterInitCallback(chip::EndpointId endpoint); - /** * @param endpoint Endpoint that is being initialized */ @@ -782,44 +762,6 @@ MatterOnOffClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAtt */ void emberAfOnOffClusterServerTickCallback(chip::EndpointId endpoint); -// -// On/off Switch Configuration Cluster -// - -/** - * @param endpoint Endpoint that is being initialized - */ -void emberAfOnOffSwitchConfigurationClusterServerInitCallback(chip::EndpointId endpoint); - -/** - * @param endpoint Endpoint that is being shutdown - */ -void MatterOnOffSwitchConfigurationClusterServerShutdownCallback(chip::EndpointId endpoint); - -/** - * @param endpoint Endpoint that is being initialized - */ -void emberAfOnOffSwitchConfigurationClusterClientInitCallback(chip::EndpointId endpoint); - -/** - * @param attributePath Concrete attribute path that changed - */ -void MatterOnOffSwitchConfigurationClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); - -/** - * @param attributePath Concrete attribute path to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -chip::Protocols::InteractionModel::Status MatterOnOffSwitchConfigurationClusterServerPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); - -/** - * @param endpoint Endpoint that is being served - */ -void emberAfOnOffSwitchConfigurationClusterServerTickCallback(chip::EndpointId endpoint); - // // Level Control Cluster // @@ -859,45 +801,6 @@ MatterLevelControlClusterServerPreAttributeChangedCallback(const chip::app::Conc */ void emberAfLevelControlClusterServerTickCallback(chip::EndpointId endpoint); -// -// Binary Input (Basic) Cluster -// - -/** - * @param endpoint Endpoint that is being initialized - */ -void emberAfBinaryInputBasicClusterServerInitCallback(chip::EndpointId endpoint); - -/** - * @param endpoint Endpoint that is being shutdown - */ -void MatterBinaryInputBasicClusterServerShutdownCallback(chip::EndpointId endpoint); - -/** - * @param endpoint Endpoint that is being initialized - */ -void emberAfBinaryInputBasicClusterClientInitCallback(chip::EndpointId endpoint); - -/** - * @param attributePath Concrete attribute path that changed - */ -void MatterBinaryInputBasicClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); - -/** - * @param attributePath Concrete attribute path to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -chip::Protocols::InteractionModel::Status -MatterBinaryInputBasicClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); - -/** - * @param endpoint Endpoint that is being served - */ -void emberAfBinaryInputBasicClusterServerTickCallback(chip::EndpointId endpoint); - // // Pulse Width Modulation Cluster // @@ -3714,45 +3617,6 @@ MatterWindowCoveringClusterServerPreAttributeChangedCallback(const chip::app::Co */ void emberAfWindowCoveringClusterServerTickCallback(chip::EndpointId endpoint); -// -// Barrier Control Cluster -// - -/** - * @param endpoint Endpoint that is being initialized - */ -void emberAfBarrierControlClusterServerInitCallback(chip::EndpointId endpoint); - -/** - * @param endpoint Endpoint that is being shutdown - */ -void MatterBarrierControlClusterServerShutdownCallback(chip::EndpointId endpoint); - -/** - * @param endpoint Endpoint that is being initialized - */ -void emberAfBarrierControlClusterClientInitCallback(chip::EndpointId endpoint); - -/** - * @param attributePath Concrete attribute path that changed - */ -void MatterBarrierControlClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); - -/** - * @param attributePath Concrete attribute path to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -chip::Protocols::InteractionModel::Status -MatterBarrierControlClusterServerPreAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath, - EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); - -/** - * @param endpoint Endpoint that is being served - */ -void emberAfBarrierControlClusterServerTickCallback(chip::EndpointId endpoint); - // // Service Area Cluster // @@ -5379,44 +5243,6 @@ chip::Protocols::InteractionModel::Status MatterCommissionerControlClusterServer */ void emberAfCommissionerControlClusterServerTickCallback(chip::EndpointId endpoint); -// -// Electrical Measurement Cluster -// - -/** - * @param endpoint Endpoint that is being initialized - */ -void emberAfElectricalMeasurementClusterServerInitCallback(chip::EndpointId endpoint); - -/** - * @param endpoint Endpoint that is being shutdown - */ -void MatterElectricalMeasurementClusterServerShutdownCallback(chip::EndpointId endpoint); - -/** - * @param endpoint Endpoint that is being initialized - */ -void emberAfElectricalMeasurementClusterClientInitCallback(chip::EndpointId endpoint); - -/** - * @param attributePath Concrete attribute path that changed - */ -void MatterElectricalMeasurementClusterServerAttributeChangedCallback(const chip::app::ConcreteAttributePath & attributePath); - -/** - * @param attributePath Concrete attribute path to be changed - * @param attributeType Attribute type - * @param size Attribute size - * @param value Attribute value - */ -chip::Protocols::InteractionModel::Status MatterElectricalMeasurementClusterServerPreAttributeChangedCallback( - const chip::app::ConcreteAttributePath & attributePath, EmberAfAttributeType attributeType, uint16_t size, uint8_t * value); - -/** - * @param endpoint Endpoint that is being served - */ -void emberAfElectricalMeasurementClusterServerTickCallback(chip::EndpointId endpoint); - // // Unit Testing Cluster // @@ -6282,18 +6108,6 @@ bool emberAfWindowCoveringClusterGoToTiltValueCallback( bool emberAfWindowCoveringClusterGoToTiltPercentageCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::WindowCovering::Commands::GoToTiltPercentage::DecodableType & commandData); -/** - * @brief Barrier Control Cluster BarrierControlGoToPercent Command callback (from client) - */ -bool emberAfBarrierControlClusterBarrierControlGoToPercentCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::BarrierControl::Commands::BarrierControlGoToPercent::DecodableType & commandData); -/** - * @brief Barrier Control Cluster BarrierControlStop Command callback (from client) - */ -bool emberAfBarrierControlClusterBarrierControlStopCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::BarrierControl::Commands::BarrierControlStop::DecodableType & commandData); /** * @brief Thermostat Cluster SetpointRaiseLower Command callback (from client) */ @@ -6755,18 +6569,6 @@ bool emberAfCommissionerControlClusterRequestCommissioningApprovalCallback( bool emberAfCommissionerControlClusterCommissionNodeCallback( chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, const chip::app::Clusters::CommissionerControl::Commands::CommissionNode::DecodableType & commandData); -/** - * @brief Electrical Measurement Cluster GetProfileInfoCommand Command callback (from client) - */ -bool emberAfElectricalMeasurementClusterGetProfileInfoCommandCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoCommand::DecodableType & commandData); -/** - * @brief Electrical Measurement Cluster GetMeasurementProfileCommand Command callback (from client) - */ -bool emberAfElectricalMeasurementClusterGetMeasurementProfileCommandCallback( - chip::app::CommandHandler * commandObj, const chip::app::ConcreteCommandPath & commandPath, - const chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileCommand::DecodableType & commandData); /** * @brief Unit Testing Cluster Test Command callback (from client) */ diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h index 627b5808fa7931..c55fab3f9ae9fa 100644 --- a/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/cluster-enums.h @@ -544,8 +544,6 @@ enum class OnOffControlBitmap : uint8_t }; } // namespace OnOff -namespace OnOffSwitchConfiguration {} // namespace OnOffSwitchConfiguration - namespace LevelControl { // Enum for MoveModeEnum @@ -588,8 +586,6 @@ enum class OptionsBitmap : uint8_t }; } // namespace LevelControl -namespace BinaryInputBasic {} // namespace BinaryInputBasic - namespace PulseWidthModulation {} // namespace PulseWidthModulation namespace Descriptor { @@ -3914,24 +3910,6 @@ enum class SafetyStatus : uint16_t }; } // namespace WindowCovering -namespace BarrierControl { - -// Bitmap for BarrierControlCapabilities -enum class BarrierControlCapabilities : uint8_t -{ - kPartialBarrier = 0x1, -}; - -// Bitmap for BarrierControlSafetyStatus -enum class BarrierControlSafetyStatus : uint16_t -{ - kRemoteLockout = 0x1, - kTemperDetected = 0x2, - kFailedCommunication = 0x4, - kPositionFailure = 0x8, -}; -} // namespace BarrierControl - namespace ServiceArea { // Enum for OperationalStatusEnum @@ -5425,8 +5403,6 @@ enum class SupportedDeviceCategoryBitmap : uint32_t }; } // namespace CommissionerControl -namespace ElectricalMeasurement {} // namespace ElectricalMeasurement - namespace UnitTesting { // Enum for SimpleEnum 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 78368f7293b1a4..00e32012cb3be6 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 @@ -1352,40 +1352,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace OnOff -namespace OnOffSwitchConfiguration { - -namespace Commands {} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::SwitchType::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, switchType); - case Attributes::SwitchActions::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, switchActions); - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, generatedCommandList); - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acceptedCommandList); - case Attributes::EventList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, eventList); - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, attributeList); - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, featureMap); - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, clusterRevision); - default: - return CHIP_NO_ERROR; - } -} -} // namespace Attributes - -namespace Events {} // namespace Events - -} // namespace OnOffSwitchConfiguration namespace LevelControl { namespace Commands { @@ -1861,54 +1827,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace LevelControl -namespace BinaryInputBasic { - -namespace Commands {} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::ActiveText::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, activeText); - case Attributes::Description::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, description); - case Attributes::InactiveText::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, inactiveText); - case Attributes::OutOfService::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, outOfService); - case Attributes::Polarity::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, polarity); - case Attributes::PresentValue::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, presentValue); - case Attributes::Reliability::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, reliability); - case Attributes::StatusFlags::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, statusFlags); - case Attributes::ApplicationType::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, applicationType); - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, generatedCommandList); - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acceptedCommandList); - case Attributes::EventList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, eventList); - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, attributeList); - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, featureMap); - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, clusterRevision); - default: - return CHIP_NO_ERROR; - } -} -} // namespace Attributes - -namespace Events {} // namespace Events - -} // namespace BinaryInputBasic namespace PulseWidthModulation { namespace Commands {} // namespace Commands @@ -20314,111 +20232,6 @@ CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const Concre namespace Events {} // namespace Events } // namespace WindowCovering -namespace BarrierControl { - -namespace Commands { -namespace BarrierControlGoToPercent { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kPercentOpen), percentOpen); - return encoder.Finalize(); -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - detail::StructDecodeIterator __iterator(reader); - while (true) - { - auto __element = __iterator.Next(); - if (std::holds_alternative(__element)) - { - return std::get(__element); - } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kPercentOpen)) - { - err = DataModel::Decode(reader, percentOpen); - } - else - { - } - - ReturnErrorOnFailure(err); - } -} -} // namespace BarrierControlGoToPercent. -namespace BarrierControlStop { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - return encoder.Finalize(); -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - detail::StructDecodeIterator __iterator(reader); - while (true) - { - auto __element = __iterator.Next(); - if (std::holds_alternative(__element)) - { - return std::get(__element); - } - } -} -} // namespace BarrierControlStop. -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::BarrierMovingState::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, barrierMovingState); - case Attributes::BarrierSafetyStatus::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, barrierSafetyStatus); - case Attributes::BarrierCapabilities::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, barrierCapabilities); - case Attributes::BarrierOpenEvents::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, barrierOpenEvents); - case Attributes::BarrierCloseEvents::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, barrierCloseEvents); - case Attributes::BarrierCommandOpenEvents::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, barrierCommandOpenEvents); - case Attributes::BarrierCommandCloseEvents::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, barrierCommandCloseEvents); - case Attributes::BarrierOpenPeriod::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, barrierOpenPeriod); - case Attributes::BarrierClosePeriod::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, barrierClosePeriod); - case Attributes::BarrierPosition::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, barrierPosition); - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, generatedCommandList); - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acceptedCommandList); - case Attributes::EventList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, eventList); - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, attributeList); - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, featureMap); - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, clusterRevision); - default: - return CHIP_NO_ERROR; - } -} -} // namespace Attributes - -namespace Events {} // namespace Events - -} // namespace BarrierControl namespace ServiceArea { namespace Structs { @@ -29106,465 +28919,6 @@ CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) } // namespace Events } // namespace CommissionerControl -namespace ElectricalMeasurement { - -namespace Commands { -namespace GetProfileInfoResponseCommand { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kProfileCount), profileCount); - encoder.Encode(to_underlying(Fields::kProfileIntervalPeriod), profileIntervalPeriod); - encoder.Encode(to_underlying(Fields::kMaxNumberOfIntervals), maxNumberOfIntervals); - encoder.Encode(to_underlying(Fields::kListOfAttributes), listOfAttributes); - return encoder.Finalize(); -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - detail::StructDecodeIterator __iterator(reader); - while (true) - { - auto __element = __iterator.Next(); - if (std::holds_alternative(__element)) - { - return std::get(__element); - } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kProfileCount)) - { - err = DataModel::Decode(reader, profileCount); - } - else if (__context_tag == to_underlying(Fields::kProfileIntervalPeriod)) - { - err = DataModel::Decode(reader, profileIntervalPeriod); - } - else if (__context_tag == to_underlying(Fields::kMaxNumberOfIntervals)) - { - err = DataModel::Decode(reader, maxNumberOfIntervals); - } - else if (__context_tag == to_underlying(Fields::kListOfAttributes)) - { - err = DataModel::Decode(reader, listOfAttributes); - } - else - { - } - - ReturnErrorOnFailure(err); - } -} -} // namespace GetProfileInfoResponseCommand. -namespace GetProfileInfoCommand { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - return encoder.Finalize(); -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - detail::StructDecodeIterator __iterator(reader); - while (true) - { - auto __element = __iterator.Next(); - if (std::holds_alternative(__element)) - { - return std::get(__element); - } - } -} -} // namespace GetProfileInfoCommand. -namespace GetMeasurementProfileResponseCommand { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kStartTime), startTime); - encoder.Encode(to_underlying(Fields::kStatus), status); - encoder.Encode(to_underlying(Fields::kProfileIntervalPeriod), profileIntervalPeriod); - encoder.Encode(to_underlying(Fields::kNumberOfIntervalsDelivered), numberOfIntervalsDelivered); - encoder.Encode(to_underlying(Fields::kAttributeId), attributeId); - encoder.Encode(to_underlying(Fields::kIntervals), intervals); - return encoder.Finalize(); -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - detail::StructDecodeIterator __iterator(reader); - while (true) - { - auto __element = __iterator.Next(); - if (std::holds_alternative(__element)) - { - return std::get(__element); - } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kStartTime)) - { - err = DataModel::Decode(reader, startTime); - } - else if (__context_tag == to_underlying(Fields::kStatus)) - { - err = DataModel::Decode(reader, status); - } - else if (__context_tag == to_underlying(Fields::kProfileIntervalPeriod)) - { - err = DataModel::Decode(reader, profileIntervalPeriod); - } - else if (__context_tag == to_underlying(Fields::kNumberOfIntervalsDelivered)) - { - err = DataModel::Decode(reader, numberOfIntervalsDelivered); - } - else if (__context_tag == to_underlying(Fields::kAttributeId)) - { - err = DataModel::Decode(reader, attributeId); - } - else if (__context_tag == to_underlying(Fields::kIntervals)) - { - err = DataModel::Decode(reader, intervals); - } - else - { - } - - ReturnErrorOnFailure(err); - } -} -} // namespace GetMeasurementProfileResponseCommand. -namespace GetMeasurementProfileCommand { -CHIP_ERROR Type::Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const -{ - DataModel::WrappedStructEncoder encoder{ aWriter, aTag }; - encoder.Encode(to_underlying(Fields::kAttributeId), attributeId); - encoder.Encode(to_underlying(Fields::kStartTime), startTime); - encoder.Encode(to_underlying(Fields::kNumberOfIntervals), numberOfIntervals); - return encoder.Finalize(); -} - -CHIP_ERROR DecodableType::Decode(TLV::TLVReader & reader) -{ - detail::StructDecodeIterator __iterator(reader); - while (true) - { - auto __element = __iterator.Next(); - if (std::holds_alternative(__element)) - { - return std::get(__element); - } - - CHIP_ERROR err = CHIP_NO_ERROR; - const uint8_t __context_tag = std::get(__element); - - if (__context_tag == to_underlying(Fields::kAttributeId)) - { - err = DataModel::Decode(reader, attributeId); - } - else if (__context_tag == to_underlying(Fields::kStartTime)) - { - err = DataModel::Decode(reader, startTime); - } - else if (__context_tag == to_underlying(Fields::kNumberOfIntervals)) - { - err = DataModel::Decode(reader, numberOfIntervals); - } - else - { - } - - ReturnErrorOnFailure(err); - } -} -} // namespace GetMeasurementProfileCommand. -} // namespace Commands - -namespace Attributes { -CHIP_ERROR TypeInfo::DecodableType::Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path) -{ - switch (path.mAttributeId) - { - case Attributes::MeasurementType::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, measurementType); - case Attributes::DcVoltage::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, dcVoltage); - case Attributes::DcVoltageMin::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, dcVoltageMin); - case Attributes::DcVoltageMax::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, dcVoltageMax); - case Attributes::DcCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, dcCurrent); - case Attributes::DcCurrentMin::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, dcCurrentMin); - case Attributes::DcCurrentMax::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, dcCurrentMax); - case Attributes::DcPower::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, dcPower); - case Attributes::DcPowerMin::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, dcPowerMin); - case Attributes::DcPowerMax::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, dcPowerMax); - case Attributes::DcVoltageMultiplier::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, dcVoltageMultiplier); - case Attributes::DcVoltageDivisor::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, dcVoltageDivisor); - case Attributes::DcCurrentMultiplier::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, dcCurrentMultiplier); - case Attributes::DcCurrentDivisor::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, dcCurrentDivisor); - case Attributes::DcPowerMultiplier::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, dcPowerMultiplier); - case Attributes::DcPowerDivisor::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, dcPowerDivisor); - case Attributes::AcFrequency::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acFrequency); - case Attributes::AcFrequencyMin::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acFrequencyMin); - case Attributes::AcFrequencyMax::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acFrequencyMax); - case Attributes::NeutralCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, neutralCurrent); - case Attributes::TotalActivePower::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, totalActivePower); - case Attributes::TotalReactivePower::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, totalReactivePower); - case Attributes::TotalApparentPower::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, totalApparentPower); - case Attributes::Measured1stHarmonicCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, measured1stHarmonicCurrent); - case Attributes::Measured3rdHarmonicCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, measured3rdHarmonicCurrent); - case Attributes::Measured5thHarmonicCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, measured5thHarmonicCurrent); - case Attributes::Measured7thHarmonicCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, measured7thHarmonicCurrent); - case Attributes::Measured9thHarmonicCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, measured9thHarmonicCurrent); - case Attributes::Measured11thHarmonicCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, measured11thHarmonicCurrent); - case Attributes::MeasuredPhase1stHarmonicCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, measuredPhase1stHarmonicCurrent); - case Attributes::MeasuredPhase3rdHarmonicCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, measuredPhase3rdHarmonicCurrent); - case Attributes::MeasuredPhase5thHarmonicCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, measuredPhase5thHarmonicCurrent); - case Attributes::MeasuredPhase7thHarmonicCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, measuredPhase7thHarmonicCurrent); - case Attributes::MeasuredPhase9thHarmonicCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, measuredPhase9thHarmonicCurrent); - case Attributes::MeasuredPhase11thHarmonicCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, measuredPhase11thHarmonicCurrent); - case Attributes::AcFrequencyMultiplier::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acFrequencyMultiplier); - case Attributes::AcFrequencyDivisor::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acFrequencyDivisor); - case Attributes::PowerMultiplier::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, powerMultiplier); - case Attributes::PowerDivisor::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, powerDivisor); - case Attributes::HarmonicCurrentMultiplier::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, harmonicCurrentMultiplier); - case Attributes::PhaseHarmonicCurrentMultiplier::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, phaseHarmonicCurrentMultiplier); - case Attributes::InstantaneousVoltage::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, instantaneousVoltage); - case Attributes::InstantaneousLineCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, instantaneousLineCurrent); - case Attributes::InstantaneousActiveCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, instantaneousActiveCurrent); - case Attributes::InstantaneousReactiveCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, instantaneousReactiveCurrent); - case Attributes::InstantaneousPower::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, instantaneousPower); - case Attributes::RmsVoltage::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltage); - case Attributes::RmsVoltageMin::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltageMin); - case Attributes::RmsVoltageMax::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltageMax); - case Attributes::RmsCurrent::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsCurrent); - case Attributes::RmsCurrentMin::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsCurrentMin); - case Attributes::RmsCurrentMax::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsCurrentMax); - case Attributes::ActivePower::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, activePower); - case Attributes::ActivePowerMin::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, activePowerMin); - case Attributes::ActivePowerMax::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, activePowerMax); - case Attributes::ReactivePower::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, reactivePower); - case Attributes::ApparentPower::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, apparentPower); - case Attributes::PowerFactor::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, powerFactor); - case Attributes::AverageRmsVoltageMeasurementPeriod::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, averageRmsVoltageMeasurementPeriod); - case Attributes::AverageRmsUnderVoltageCounter::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, averageRmsUnderVoltageCounter); - case Attributes::RmsExtremeOverVoltagePeriod::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsExtremeOverVoltagePeriod); - case Attributes::RmsExtremeUnderVoltagePeriod::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsExtremeUnderVoltagePeriod); - case Attributes::RmsVoltageSagPeriod::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltageSagPeriod); - case Attributes::RmsVoltageSwellPeriod::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltageSwellPeriod); - case Attributes::AcVoltageMultiplier::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acVoltageMultiplier); - case Attributes::AcVoltageDivisor::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acVoltageDivisor); - case Attributes::AcCurrentMultiplier::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acCurrentMultiplier); - case Attributes::AcCurrentDivisor::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acCurrentDivisor); - case Attributes::AcPowerMultiplier::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acPowerMultiplier); - case Attributes::AcPowerDivisor::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acPowerDivisor); - case Attributes::OverloadAlarmsMask::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, overloadAlarmsMask); - case Attributes::VoltageOverload::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, voltageOverload); - case Attributes::CurrentOverload::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, currentOverload); - case Attributes::AcOverloadAlarmsMask::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acOverloadAlarmsMask); - case Attributes::AcVoltageOverload::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acVoltageOverload); - case Attributes::AcCurrentOverload::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acCurrentOverload); - case Attributes::AcActivePowerOverload::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acActivePowerOverload); - case Attributes::AcReactivePowerOverload::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acReactivePowerOverload); - case Attributes::AverageRmsOverVoltage::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, averageRmsOverVoltage); - case Attributes::AverageRmsUnderVoltage::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, averageRmsUnderVoltage); - case Attributes::RmsExtremeOverVoltage::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsExtremeOverVoltage); - case Attributes::RmsExtremeUnderVoltage::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsExtremeUnderVoltage); - case Attributes::RmsVoltageSag::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltageSag); - case Attributes::RmsVoltageSwell::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltageSwell); - case Attributes::LineCurrentPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, lineCurrentPhaseB); - case Attributes::ActiveCurrentPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, activeCurrentPhaseB); - case Attributes::ReactiveCurrentPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, reactiveCurrentPhaseB); - case Attributes::RmsVoltagePhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltagePhaseB); - case Attributes::RmsVoltageMinPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltageMinPhaseB); - case Attributes::RmsVoltageMaxPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltageMaxPhaseB); - case Attributes::RmsCurrentPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsCurrentPhaseB); - case Attributes::RmsCurrentMinPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsCurrentMinPhaseB); - case Attributes::RmsCurrentMaxPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsCurrentMaxPhaseB); - case Attributes::ActivePowerPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, activePowerPhaseB); - case Attributes::ActivePowerMinPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, activePowerMinPhaseB); - case Attributes::ActivePowerMaxPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, activePowerMaxPhaseB); - case Attributes::ReactivePowerPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, reactivePowerPhaseB); - case Attributes::ApparentPowerPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, apparentPowerPhaseB); - case Attributes::PowerFactorPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, powerFactorPhaseB); - case Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, averageRmsVoltageMeasurementPeriodPhaseB); - case Attributes::AverageRmsOverVoltageCounterPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, averageRmsOverVoltageCounterPhaseB); - case Attributes::AverageRmsUnderVoltageCounterPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, averageRmsUnderVoltageCounterPhaseB); - case Attributes::RmsExtremeOverVoltagePeriodPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsExtremeOverVoltagePeriodPhaseB); - case Attributes::RmsExtremeUnderVoltagePeriodPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsExtremeUnderVoltagePeriodPhaseB); - case Attributes::RmsVoltageSagPeriodPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltageSagPeriodPhaseB); - case Attributes::RmsVoltageSwellPeriodPhaseB::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltageSwellPeriodPhaseB); - case Attributes::LineCurrentPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, lineCurrentPhaseC); - case Attributes::ActiveCurrentPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, activeCurrentPhaseC); - case Attributes::ReactiveCurrentPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, reactiveCurrentPhaseC); - case Attributes::RmsVoltagePhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltagePhaseC); - case Attributes::RmsVoltageMinPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltageMinPhaseC); - case Attributes::RmsVoltageMaxPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltageMaxPhaseC); - case Attributes::RmsCurrentPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsCurrentPhaseC); - case Attributes::RmsCurrentMinPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsCurrentMinPhaseC); - case Attributes::RmsCurrentMaxPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsCurrentMaxPhaseC); - case Attributes::ActivePowerPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, activePowerPhaseC); - case Attributes::ActivePowerMinPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, activePowerMinPhaseC); - case Attributes::ActivePowerMaxPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, activePowerMaxPhaseC); - case Attributes::ReactivePowerPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, reactivePowerPhaseC); - case Attributes::ApparentPowerPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, apparentPowerPhaseC); - case Attributes::PowerFactorPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, powerFactorPhaseC); - case Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, averageRmsVoltageMeasurementPeriodPhaseC); - case Attributes::AverageRmsOverVoltageCounterPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, averageRmsOverVoltageCounterPhaseC); - case Attributes::AverageRmsUnderVoltageCounterPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, averageRmsUnderVoltageCounterPhaseC); - case Attributes::RmsExtremeOverVoltagePeriodPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsExtremeOverVoltagePeriodPhaseC); - case Attributes::RmsExtremeUnderVoltagePeriodPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsExtremeUnderVoltagePeriodPhaseC); - case Attributes::RmsVoltageSagPeriodPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltageSagPeriodPhaseC); - case Attributes::RmsVoltageSwellPeriodPhaseC::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, rmsVoltageSwellPeriodPhaseC); - case Attributes::GeneratedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, generatedCommandList); - case Attributes::AcceptedCommandList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, acceptedCommandList); - case Attributes::EventList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, eventList); - case Attributes::AttributeList::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, attributeList); - case Attributes::FeatureMap::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, featureMap); - case Attributes::ClusterRevision::TypeInfo::GetAttributeId(): - return DataModel::Decode(reader, clusterRevision); - default: - return CHIP_NO_ERROR; - } -} -} // namespace Attributes - -namespace Events {} // namespace Events - -} // namespace ElectricalMeasurement namespace UnitTesting { namespace Structs { @@ -32901,13 +32255,6 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } - case Clusters::BarrierControl::Id: { - switch (aCommand) - { - default: - return false; - } - } case Clusters::ServiceArea::Id: { switch (aCommand) { @@ -33054,13 +32401,6 @@ bool CommandIsFabricScoped(ClusterId aCluster, CommandId aCommand) return false; } } - case Clusters::ElectricalMeasurement::Id: { - switch (aCommand) - { - default: - return false; - } - } case Clusters::UnitTesting::Id: { switch (aCommand) { diff --git a/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h b/zzz_generated/app-common/app-common/zap-generated/cluster-objects.h index 2aaf40bdbad6f9..f8847a3f1a0b51 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 @@ -1438,91 +1438,6 @@ struct TypeInfo }; } // namespace Attributes } // namespace OnOff -namespace OnOffSwitchConfiguration { - -namespace Attributes { - -namespace SwitchType { -struct TypeInfo -{ - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::OnOffSwitchConfiguration::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::SwitchType::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace SwitchType -namespace SwitchActions { -struct TypeInfo -{ - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::OnOffSwitchConfiguration::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::SwitchActions::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace SwitchActions -namespace GeneratedCommandList { -struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::OnOffSwitchConfiguration::Id; } -}; -} // namespace GeneratedCommandList -namespace AcceptedCommandList { -struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::OnOffSwitchConfiguration::Id; } -}; -} // namespace AcceptedCommandList -namespace EventList { -struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::OnOffSwitchConfiguration::Id; } -}; -} // namespace EventList -namespace AttributeList { -struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::OnOffSwitchConfiguration::Id; } -}; -} // namespace AttributeList -namespace FeatureMap { -struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::OnOffSwitchConfiguration::Id; } -}; -} // namespace FeatureMap -namespace ClusterRevision { -struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::OnOffSwitchConfiguration::Id; } -}; -} // namespace ClusterRevision - -struct TypeInfo -{ - struct DecodableType - { - static constexpr ClusterId GetClusterId() { return Clusters::OnOffSwitchConfiguration::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - - Attributes::SwitchType::TypeInfo::DecodableType switchType = static_cast(0); - Attributes::SwitchActions::TypeInfo::DecodableType switchActions = static_cast(0); - Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; - Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; - Attributes::EventList::TypeInfo::DecodableType eventList; - Attributes::AttributeList::TypeInfo::DecodableType attributeList; - Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); - Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); - }; -}; -} // namespace Attributes -} // namespace OnOffSwitchConfiguration namespace LevelControl { namespace Commands { @@ -2172,185 +2087,6 @@ struct TypeInfo }; } // namespace Attributes } // namespace LevelControl -namespace BinaryInputBasic { - -namespace Attributes { - -namespace ActiveText { -struct TypeInfo -{ - using Type = chip::CharSpan; - using DecodableType = chip::CharSpan; - using DecodableArgType = chip::CharSpan; - - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ActiveText::Id; } - static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 16; } -}; -} // namespace ActiveText -namespace Description { -struct TypeInfo -{ - using Type = chip::CharSpan; - using DecodableType = chip::CharSpan; - using DecodableArgType = chip::CharSpan; - - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Description::Id; } - static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 16; } -}; -} // namespace Description -namespace InactiveText { -struct TypeInfo -{ - using Type = chip::CharSpan; - using DecodableType = chip::CharSpan; - using DecodableArgType = chip::CharSpan; - - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::InactiveText::Id; } - static constexpr bool MustUseTimedWrite() { return false; } - static constexpr size_t MaxLength() { return 16; } -}; -} // namespace InactiveText -namespace OutOfService { -struct TypeInfo -{ - using Type = bool; - using DecodableType = bool; - using DecodableArgType = bool; - - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::OutOfService::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace OutOfService -namespace Polarity { -struct TypeInfo -{ - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Polarity::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace Polarity -namespace PresentValue { -struct TypeInfo -{ - using Type = bool; - using DecodableType = bool; - using DecodableArgType = bool; - - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::PresentValue::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace PresentValue -namespace Reliability { -struct TypeInfo -{ - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Reliability::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace Reliability -namespace StatusFlags { -struct TypeInfo -{ - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::StatusFlags::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace StatusFlags -namespace ApplicationType { -struct TypeInfo -{ - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ApplicationType::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ApplicationType -namespace GeneratedCommandList { -struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } -}; -} // namespace GeneratedCommandList -namespace AcceptedCommandList { -struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } -}; -} // namespace AcceptedCommandList -namespace EventList { -struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } -}; -} // namespace EventList -namespace AttributeList { -struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } -}; -} // namespace AttributeList -namespace FeatureMap { -struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } -}; -} // namespace FeatureMap -namespace ClusterRevision { -struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } -}; -} // namespace ClusterRevision - -struct TypeInfo -{ - struct DecodableType - { - static constexpr ClusterId GetClusterId() { return Clusters::BinaryInputBasic::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - - Attributes::ActiveText::TypeInfo::DecodableType activeText; - Attributes::Description::TypeInfo::DecodableType description; - Attributes::InactiveText::TypeInfo::DecodableType inactiveText; - Attributes::OutOfService::TypeInfo::DecodableType outOfService = static_cast(0); - Attributes::Polarity::TypeInfo::DecodableType polarity = static_cast(0); - Attributes::PresentValue::TypeInfo::DecodableType presentValue = static_cast(0); - Attributes::Reliability::TypeInfo::DecodableType reliability = static_cast(0); - Attributes::StatusFlags::TypeInfo::DecodableType statusFlags = static_cast(0); - Attributes::ApplicationType::TypeInfo::DecodableType applicationType = static_cast(0); - Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; - Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; - Attributes::EventList::TypeInfo::DecodableType eventList; - Attributes::AttributeList::TypeInfo::DecodableType attributeList; - Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); - Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); - }; -}; -} // namespace Attributes -} // namespace BinaryInputBasic namespace PulseWidthModulation { namespace Attributes { @@ -28124,273 +27860,6 @@ struct TypeInfo }; } // namespace Attributes } // namespace WindowCovering -namespace BarrierControl { - -namespace Commands { -// Forward-declarations so we can reference these later. - -namespace BarrierControlGoToPercent { -struct Type; -struct DecodableType; -} // namespace BarrierControlGoToPercent - -namespace BarrierControlStop { -struct Type; -struct DecodableType; -} // namespace BarrierControlStop - -} // namespace Commands - -namespace Commands { -namespace BarrierControlGoToPercent { -enum class Fields : uint8_t -{ - kPercentOpen = 0, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::BarrierControlGoToPercent::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } - - uint8_t percentOpen = static_cast(0); - - CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::BarrierControlGoToPercent::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } - - uint8_t percentOpen = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace BarrierControlGoToPercent -namespace BarrierControlStop { -enum class Fields : uint8_t -{ -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::BarrierControlStop::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } - - CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::BarrierControlStop::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace BarrierControlStop -} // namespace Commands - -namespace Attributes { - -namespace BarrierMovingState { -struct TypeInfo -{ - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::BarrierMovingState::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace BarrierMovingState -namespace BarrierSafetyStatus { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::BarrierSafetyStatus::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace BarrierSafetyStatus -namespace BarrierCapabilities { -struct TypeInfo -{ - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::BarrierCapabilities::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace BarrierCapabilities -namespace BarrierOpenEvents { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::BarrierOpenEvents::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace BarrierOpenEvents -namespace BarrierCloseEvents { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::BarrierCloseEvents::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace BarrierCloseEvents -namespace BarrierCommandOpenEvents { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::BarrierCommandOpenEvents::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace BarrierCommandOpenEvents -namespace BarrierCommandCloseEvents { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::BarrierCommandCloseEvents::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace BarrierCommandCloseEvents -namespace BarrierOpenPeriod { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::BarrierOpenPeriod::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace BarrierOpenPeriod -namespace BarrierClosePeriod { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::BarrierClosePeriod::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace BarrierClosePeriod -namespace BarrierPosition { -struct TypeInfo -{ - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::BarrierPosition::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace BarrierPosition -namespace GeneratedCommandList { -struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } -}; -} // namespace GeneratedCommandList -namespace AcceptedCommandList { -struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } -}; -} // namespace AcceptedCommandList -namespace EventList { -struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } -}; -} // namespace EventList -namespace AttributeList { -struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } -}; -} // namespace AttributeList -namespace FeatureMap { -struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } -}; -} // namespace FeatureMap -namespace ClusterRevision { -struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } -}; -} // namespace ClusterRevision - -struct TypeInfo -{ - struct DecodableType - { - static constexpr ClusterId GetClusterId() { return Clusters::BarrierControl::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - - Attributes::BarrierMovingState::TypeInfo::DecodableType barrierMovingState = static_cast(0); - Attributes::BarrierSafetyStatus::TypeInfo::DecodableType barrierSafetyStatus = static_cast(0); - Attributes::BarrierCapabilities::TypeInfo::DecodableType barrierCapabilities = static_cast(0); - Attributes::BarrierOpenEvents::TypeInfo::DecodableType barrierOpenEvents = static_cast(0); - Attributes::BarrierCloseEvents::TypeInfo::DecodableType barrierCloseEvents = static_cast(0); - Attributes::BarrierCommandOpenEvents::TypeInfo::DecodableType barrierCommandOpenEvents = static_cast(0); - Attributes::BarrierCommandCloseEvents::TypeInfo::DecodableType barrierCommandCloseEvents = static_cast(0); - Attributes::BarrierOpenPeriod::TypeInfo::DecodableType barrierOpenPeriod = static_cast(0); - Attributes::BarrierClosePeriod::TypeInfo::DecodableType barrierClosePeriod = static_cast(0); - Attributes::BarrierPosition::TypeInfo::DecodableType barrierPosition = static_cast(0); - Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; - Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; - Attributes::EventList::TypeInfo::DecodableType eventList; - Attributes::AttributeList::TypeInfo::DecodableType attributeList; - Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); - Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); - }; -}; -} // namespace Attributes -} // namespace BarrierControl namespace ServiceArea { namespace Structs { namespace LandmarkInfoStruct { @@ -42174,1928 +41643,6 @@ struct DecodableType } // namespace CommissioningRequestResult } // namespace Events } // namespace CommissionerControl -namespace ElectricalMeasurement { - -namespace Commands { -// Forward-declarations so we can reference these later. - -namespace GetProfileInfoResponseCommand { -struct Type; -struct DecodableType; -} // namespace GetProfileInfoResponseCommand - -namespace GetProfileInfoCommand { -struct Type; -struct DecodableType; -} // namespace GetProfileInfoCommand - -namespace GetMeasurementProfileResponseCommand { -struct Type; -struct DecodableType; -} // namespace GetMeasurementProfileResponseCommand - -namespace GetMeasurementProfileCommand { -struct Type; -struct DecodableType; -} // namespace GetMeasurementProfileCommand - -} // namespace Commands - -namespace Commands { -namespace GetProfileInfoResponseCommand { -enum class Fields : uint8_t -{ - kProfileCount = 0, - kProfileIntervalPeriod = 1, - kMaxNumberOfIntervals = 2, - kListOfAttributes = 3, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::GetProfileInfoResponseCommand::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - - uint8_t profileCount = static_cast(0); - uint8_t profileIntervalPeriod = static_cast(0); - uint8_t maxNumberOfIntervals = static_cast(0); - DataModel::List listOfAttributes; - - CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::GetProfileInfoResponseCommand::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - - uint8_t profileCount = static_cast(0); - uint8_t profileIntervalPeriod = static_cast(0); - uint8_t maxNumberOfIntervals = static_cast(0); - DataModel::DecodableList listOfAttributes; - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace GetProfileInfoResponseCommand -namespace GetProfileInfoCommand { -enum class Fields : uint8_t -{ -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::GetProfileInfoCommand::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - - CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::GetProfileInfoCommand::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace GetProfileInfoCommand -namespace GetMeasurementProfileResponseCommand { -enum class Fields : uint8_t -{ - kStartTime = 0, - kStatus = 1, - kProfileIntervalPeriod = 2, - kNumberOfIntervalsDelivered = 3, - kAttributeId = 4, - kIntervals = 5, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::GetMeasurementProfileResponseCommand::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - - uint32_t startTime = static_cast(0); - uint8_t status = static_cast(0); - uint8_t profileIntervalPeriod = static_cast(0); - uint8_t numberOfIntervalsDelivered = static_cast(0); - uint16_t attributeId = static_cast(0); - DataModel::List intervals; - - CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::GetMeasurementProfileResponseCommand::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - - uint32_t startTime = static_cast(0); - uint8_t status = static_cast(0); - uint8_t profileIntervalPeriod = static_cast(0); - uint8_t numberOfIntervalsDelivered = static_cast(0); - uint16_t attributeId = static_cast(0); - DataModel::DecodableList intervals; - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace GetMeasurementProfileResponseCommand -namespace GetMeasurementProfileCommand { -enum class Fields : uint8_t -{ - kAttributeId = 0, - kStartTime = 1, - kNumberOfIntervals = 2, -}; - -struct Type -{ -public: - // Use GetCommandId instead of commandId directly to avoid naming conflict with CommandIdentification in ExecutionOfACommand - static constexpr CommandId GetCommandId() { return Commands::GetMeasurementProfileCommand::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - - uint16_t attributeId = static_cast(0); - uint32_t startTime = static_cast(0); - uint8_t numberOfIntervals = static_cast(0); - - CHIP_ERROR Encode(TLV::TLVWriter & aWriter, TLV::Tag aTag) const; - - using ResponseType = DataModel::NullObjectType; - - static constexpr bool MustUseTimedInvoke() { return false; } -}; - -struct DecodableType -{ -public: - static constexpr CommandId GetCommandId() { return Commands::GetMeasurementProfileCommand::Id; } - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - - uint16_t attributeId = static_cast(0); - uint32_t startTime = static_cast(0); - uint8_t numberOfIntervals = static_cast(0); - CHIP_ERROR Decode(TLV::TLVReader & reader); -}; -}; // namespace GetMeasurementProfileCommand -} // namespace Commands - -namespace Attributes { - -namespace MeasurementType { -struct TypeInfo -{ - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::MeasurementType::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace MeasurementType -namespace DcVoltage { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DcVoltage::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DcVoltage -namespace DcVoltageMin { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DcVoltageMin::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DcVoltageMin -namespace DcVoltageMax { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DcVoltageMax::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DcVoltageMax -namespace DcCurrent { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DcCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DcCurrent -namespace DcCurrentMin { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DcCurrentMin::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DcCurrentMin -namespace DcCurrentMax { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DcCurrentMax::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DcCurrentMax -namespace DcPower { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DcPower::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DcPower -namespace DcPowerMin { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DcPowerMin::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DcPowerMin -namespace DcPowerMax { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DcPowerMax::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DcPowerMax -namespace DcVoltageMultiplier { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DcVoltageMultiplier::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DcVoltageMultiplier -namespace DcVoltageDivisor { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DcVoltageDivisor::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DcVoltageDivisor -namespace DcCurrentMultiplier { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DcCurrentMultiplier::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DcCurrentMultiplier -namespace DcCurrentDivisor { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DcCurrentDivisor::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DcCurrentDivisor -namespace DcPowerMultiplier { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DcPowerMultiplier::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DcPowerMultiplier -namespace DcPowerDivisor { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::DcPowerDivisor::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace DcPowerDivisor -namespace AcFrequency { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcFrequency::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcFrequency -namespace AcFrequencyMin { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcFrequencyMin::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcFrequencyMin -namespace AcFrequencyMax { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcFrequencyMax::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcFrequencyMax -namespace NeutralCurrent { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::NeutralCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace NeutralCurrent -namespace TotalActivePower { -struct TypeInfo -{ - using Type = int32_t; - using DecodableType = int32_t; - using DecodableArgType = int32_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::TotalActivePower::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace TotalActivePower -namespace TotalReactivePower { -struct TypeInfo -{ - using Type = int32_t; - using DecodableType = int32_t; - using DecodableArgType = int32_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::TotalReactivePower::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace TotalReactivePower -namespace TotalApparentPower { -struct TypeInfo -{ - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::TotalApparentPower::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace TotalApparentPower -namespace Measured1stHarmonicCurrent { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Measured1stHarmonicCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace Measured1stHarmonicCurrent -namespace Measured3rdHarmonicCurrent { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Measured3rdHarmonicCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace Measured3rdHarmonicCurrent -namespace Measured5thHarmonicCurrent { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Measured5thHarmonicCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace Measured5thHarmonicCurrent -namespace Measured7thHarmonicCurrent { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Measured7thHarmonicCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace Measured7thHarmonicCurrent -namespace Measured9thHarmonicCurrent { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Measured9thHarmonicCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace Measured9thHarmonicCurrent -namespace Measured11thHarmonicCurrent { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::Measured11thHarmonicCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace Measured11thHarmonicCurrent -namespace MeasuredPhase1stHarmonicCurrent { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::MeasuredPhase1stHarmonicCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace MeasuredPhase1stHarmonicCurrent -namespace MeasuredPhase3rdHarmonicCurrent { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::MeasuredPhase3rdHarmonicCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace MeasuredPhase3rdHarmonicCurrent -namespace MeasuredPhase5thHarmonicCurrent { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::MeasuredPhase5thHarmonicCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace MeasuredPhase5thHarmonicCurrent -namespace MeasuredPhase7thHarmonicCurrent { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::MeasuredPhase7thHarmonicCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace MeasuredPhase7thHarmonicCurrent -namespace MeasuredPhase9thHarmonicCurrent { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::MeasuredPhase9thHarmonicCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace MeasuredPhase9thHarmonicCurrent -namespace MeasuredPhase11thHarmonicCurrent { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::MeasuredPhase11thHarmonicCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace MeasuredPhase11thHarmonicCurrent -namespace AcFrequencyMultiplier { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcFrequencyMultiplier::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcFrequencyMultiplier -namespace AcFrequencyDivisor { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcFrequencyDivisor::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcFrequencyDivisor -namespace PowerMultiplier { -struct TypeInfo -{ - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::PowerMultiplier::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace PowerMultiplier -namespace PowerDivisor { -struct TypeInfo -{ - using Type = uint32_t; - using DecodableType = uint32_t; - using DecodableArgType = uint32_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::PowerDivisor::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace PowerDivisor -namespace HarmonicCurrentMultiplier { -struct TypeInfo -{ - using Type = int8_t; - using DecodableType = int8_t; - using DecodableArgType = int8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::HarmonicCurrentMultiplier::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace HarmonicCurrentMultiplier -namespace PhaseHarmonicCurrentMultiplier { -struct TypeInfo -{ - using Type = int8_t; - using DecodableType = int8_t; - using DecodableArgType = int8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::PhaseHarmonicCurrentMultiplier::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace PhaseHarmonicCurrentMultiplier -namespace InstantaneousVoltage { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::InstantaneousVoltage::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace InstantaneousVoltage -namespace InstantaneousLineCurrent { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::InstantaneousLineCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace InstantaneousLineCurrent -namespace InstantaneousActiveCurrent { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::InstantaneousActiveCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace InstantaneousActiveCurrent -namespace InstantaneousReactiveCurrent { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::InstantaneousReactiveCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace InstantaneousReactiveCurrent -namespace InstantaneousPower { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::InstantaneousPower::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace InstantaneousPower -namespace RmsVoltage { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltage::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltage -namespace RmsVoltageMin { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltageMin::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltageMin -namespace RmsVoltageMax { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltageMax::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltageMax -namespace RmsCurrent { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsCurrent::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsCurrent -namespace RmsCurrentMin { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsCurrentMin::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsCurrentMin -namespace RmsCurrentMax { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsCurrentMax::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsCurrentMax -namespace ActivePower { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ActivePower::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ActivePower -namespace ActivePowerMin { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ActivePowerMin::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ActivePowerMin -namespace ActivePowerMax { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ActivePowerMax::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ActivePowerMax -namespace ReactivePower { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ReactivePower::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ReactivePower -namespace ApparentPower { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ApparentPower::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ApparentPower -namespace PowerFactor { -struct TypeInfo -{ - using Type = int8_t; - using DecodableType = int8_t; - using DecodableArgType = int8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::PowerFactor::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace PowerFactor -namespace AverageRmsVoltageMeasurementPeriod { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AverageRmsVoltageMeasurementPeriod::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AverageRmsVoltageMeasurementPeriod -namespace AverageRmsUnderVoltageCounter { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AverageRmsUnderVoltageCounter::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AverageRmsUnderVoltageCounter -namespace RmsExtremeOverVoltagePeriod { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsExtremeOverVoltagePeriod::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsExtremeOverVoltagePeriod -namespace RmsExtremeUnderVoltagePeriod { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsExtremeUnderVoltagePeriod::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsExtremeUnderVoltagePeriod -namespace RmsVoltageSagPeriod { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltageSagPeriod::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltageSagPeriod -namespace RmsVoltageSwellPeriod { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltageSwellPeriod::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltageSwellPeriod -namespace AcVoltageMultiplier { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcVoltageMultiplier::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcVoltageMultiplier -namespace AcVoltageDivisor { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcVoltageDivisor::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcVoltageDivisor -namespace AcCurrentMultiplier { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcCurrentMultiplier::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcCurrentMultiplier -namespace AcCurrentDivisor { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcCurrentDivisor::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcCurrentDivisor -namespace AcPowerMultiplier { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcPowerMultiplier::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcPowerMultiplier -namespace AcPowerDivisor { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcPowerDivisor::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcPowerDivisor -namespace OverloadAlarmsMask { -struct TypeInfo -{ - using Type = uint8_t; - using DecodableType = uint8_t; - using DecodableArgType = uint8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::OverloadAlarmsMask::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace OverloadAlarmsMask -namespace VoltageOverload { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::VoltageOverload::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace VoltageOverload -namespace CurrentOverload { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::CurrentOverload::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace CurrentOverload -namespace AcOverloadAlarmsMask { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcOverloadAlarmsMask::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcOverloadAlarmsMask -namespace AcVoltageOverload { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcVoltageOverload::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcVoltageOverload -namespace AcCurrentOverload { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcCurrentOverload::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcCurrentOverload -namespace AcActivePowerOverload { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcActivePowerOverload::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcActivePowerOverload -namespace AcReactivePowerOverload { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AcReactivePowerOverload::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AcReactivePowerOverload -namespace AverageRmsOverVoltage { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AverageRmsOverVoltage::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AverageRmsOverVoltage -namespace AverageRmsUnderVoltage { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AverageRmsUnderVoltage::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AverageRmsUnderVoltage -namespace RmsExtremeOverVoltage { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsExtremeOverVoltage::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsExtremeOverVoltage -namespace RmsExtremeUnderVoltage { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsExtremeUnderVoltage::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsExtremeUnderVoltage -namespace RmsVoltageSag { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltageSag::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltageSag -namespace RmsVoltageSwell { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltageSwell::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltageSwell -namespace LineCurrentPhaseB { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::LineCurrentPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace LineCurrentPhaseB -namespace ActiveCurrentPhaseB { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ActiveCurrentPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ActiveCurrentPhaseB -namespace ReactiveCurrentPhaseB { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ReactiveCurrentPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ReactiveCurrentPhaseB -namespace RmsVoltagePhaseB { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltagePhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltagePhaseB -namespace RmsVoltageMinPhaseB { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltageMinPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltageMinPhaseB -namespace RmsVoltageMaxPhaseB { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltageMaxPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltageMaxPhaseB -namespace RmsCurrentPhaseB { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsCurrentPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsCurrentPhaseB -namespace RmsCurrentMinPhaseB { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsCurrentMinPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsCurrentMinPhaseB -namespace RmsCurrentMaxPhaseB { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsCurrentMaxPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsCurrentMaxPhaseB -namespace ActivePowerPhaseB { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ActivePowerPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ActivePowerPhaseB -namespace ActivePowerMinPhaseB { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ActivePowerMinPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ActivePowerMinPhaseB -namespace ActivePowerMaxPhaseB { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ActivePowerMaxPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ActivePowerMaxPhaseB -namespace ReactivePowerPhaseB { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ReactivePowerPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ReactivePowerPhaseB -namespace ApparentPowerPhaseB { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ApparentPowerPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ApparentPowerPhaseB -namespace PowerFactorPhaseB { -struct TypeInfo -{ - using Type = int8_t; - using DecodableType = int8_t; - using DecodableArgType = int8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::PowerFactorPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace PowerFactorPhaseB -namespace AverageRmsVoltageMeasurementPeriodPhaseB { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AverageRmsVoltageMeasurementPeriodPhaseB -namespace AverageRmsOverVoltageCounterPhaseB { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AverageRmsOverVoltageCounterPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AverageRmsOverVoltageCounterPhaseB -namespace AverageRmsUnderVoltageCounterPhaseB { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AverageRmsUnderVoltageCounterPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AverageRmsUnderVoltageCounterPhaseB -namespace RmsExtremeOverVoltagePeriodPhaseB { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsExtremeOverVoltagePeriodPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsExtremeOverVoltagePeriodPhaseB -namespace RmsExtremeUnderVoltagePeriodPhaseB { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsExtremeUnderVoltagePeriodPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsExtremeUnderVoltagePeriodPhaseB -namespace RmsVoltageSagPeriodPhaseB { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltageSagPeriodPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltageSagPeriodPhaseB -namespace RmsVoltageSwellPeriodPhaseB { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltageSwellPeriodPhaseB::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltageSwellPeriodPhaseB -namespace LineCurrentPhaseC { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::LineCurrentPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace LineCurrentPhaseC -namespace ActiveCurrentPhaseC { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ActiveCurrentPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ActiveCurrentPhaseC -namespace ReactiveCurrentPhaseC { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ReactiveCurrentPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ReactiveCurrentPhaseC -namespace RmsVoltagePhaseC { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltagePhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltagePhaseC -namespace RmsVoltageMinPhaseC { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltageMinPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltageMinPhaseC -namespace RmsVoltageMaxPhaseC { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltageMaxPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltageMaxPhaseC -namespace RmsCurrentPhaseC { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsCurrentPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsCurrentPhaseC -namespace RmsCurrentMinPhaseC { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsCurrentMinPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsCurrentMinPhaseC -namespace RmsCurrentMaxPhaseC { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsCurrentMaxPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsCurrentMaxPhaseC -namespace ActivePowerPhaseC { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ActivePowerPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ActivePowerPhaseC -namespace ActivePowerMinPhaseC { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ActivePowerMinPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ActivePowerMinPhaseC -namespace ActivePowerMaxPhaseC { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ActivePowerMaxPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ActivePowerMaxPhaseC -namespace ReactivePowerPhaseC { -struct TypeInfo -{ - using Type = int16_t; - using DecodableType = int16_t; - using DecodableArgType = int16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ReactivePowerPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ReactivePowerPhaseC -namespace ApparentPowerPhaseC { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::ApparentPowerPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace ApparentPowerPhaseC -namespace PowerFactorPhaseC { -struct TypeInfo -{ - using Type = int8_t; - using DecodableType = int8_t; - using DecodableArgType = int8_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::PowerFactorPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace PowerFactorPhaseC -namespace AverageRmsVoltageMeasurementPeriodPhaseC { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AverageRmsVoltageMeasurementPeriodPhaseC -namespace AverageRmsOverVoltageCounterPhaseC { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AverageRmsOverVoltageCounterPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AverageRmsOverVoltageCounterPhaseC -namespace AverageRmsUnderVoltageCounterPhaseC { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::AverageRmsUnderVoltageCounterPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace AverageRmsUnderVoltageCounterPhaseC -namespace RmsExtremeOverVoltagePeriodPhaseC { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsExtremeOverVoltagePeriodPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsExtremeOverVoltagePeriodPhaseC -namespace RmsExtremeUnderVoltagePeriodPhaseC { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsExtremeUnderVoltagePeriodPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsExtremeUnderVoltagePeriodPhaseC -namespace RmsVoltageSagPeriodPhaseC { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltageSagPeriodPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltageSagPeriodPhaseC -namespace RmsVoltageSwellPeriodPhaseC { -struct TypeInfo -{ - using Type = uint16_t; - using DecodableType = uint16_t; - using DecodableArgType = uint16_t; - - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - static constexpr AttributeId GetAttributeId() { return Attributes::RmsVoltageSwellPeriodPhaseC::Id; } - static constexpr bool MustUseTimedWrite() { return false; } -}; -} // namespace RmsVoltageSwellPeriodPhaseC -namespace GeneratedCommandList { -struct TypeInfo : public Clusters::Globals::Attributes::GeneratedCommandList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } -}; -} // namespace GeneratedCommandList -namespace AcceptedCommandList { -struct TypeInfo : public Clusters::Globals::Attributes::AcceptedCommandList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } -}; -} // namespace AcceptedCommandList -namespace EventList { -struct TypeInfo : public Clusters::Globals::Attributes::EventList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } -}; -} // namespace EventList -namespace AttributeList { -struct TypeInfo : public Clusters::Globals::Attributes::AttributeList::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } -}; -} // namespace AttributeList -namespace FeatureMap { -struct TypeInfo : public Clusters::Globals::Attributes::FeatureMap::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } -}; -} // namespace FeatureMap -namespace ClusterRevision { -struct TypeInfo : public Clusters::Globals::Attributes::ClusterRevision::TypeInfo -{ - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } -}; -} // namespace ClusterRevision - -struct TypeInfo -{ - struct DecodableType - { - static constexpr ClusterId GetClusterId() { return Clusters::ElectricalMeasurement::Id; } - - CHIP_ERROR Decode(TLV::TLVReader & reader, const ConcreteAttributePath & path); - - Attributes::MeasurementType::TypeInfo::DecodableType measurementType = static_cast(0); - Attributes::DcVoltage::TypeInfo::DecodableType dcVoltage = static_cast(0); - Attributes::DcVoltageMin::TypeInfo::DecodableType dcVoltageMin = static_cast(0); - Attributes::DcVoltageMax::TypeInfo::DecodableType dcVoltageMax = static_cast(0); - Attributes::DcCurrent::TypeInfo::DecodableType dcCurrent = static_cast(0); - Attributes::DcCurrentMin::TypeInfo::DecodableType dcCurrentMin = static_cast(0); - Attributes::DcCurrentMax::TypeInfo::DecodableType dcCurrentMax = static_cast(0); - Attributes::DcPower::TypeInfo::DecodableType dcPower = static_cast(0); - Attributes::DcPowerMin::TypeInfo::DecodableType dcPowerMin = static_cast(0); - Attributes::DcPowerMax::TypeInfo::DecodableType dcPowerMax = static_cast(0); - Attributes::DcVoltageMultiplier::TypeInfo::DecodableType dcVoltageMultiplier = static_cast(0); - Attributes::DcVoltageDivisor::TypeInfo::DecodableType dcVoltageDivisor = static_cast(0); - Attributes::DcCurrentMultiplier::TypeInfo::DecodableType dcCurrentMultiplier = static_cast(0); - Attributes::DcCurrentDivisor::TypeInfo::DecodableType dcCurrentDivisor = static_cast(0); - Attributes::DcPowerMultiplier::TypeInfo::DecodableType dcPowerMultiplier = static_cast(0); - Attributes::DcPowerDivisor::TypeInfo::DecodableType dcPowerDivisor = static_cast(0); - Attributes::AcFrequency::TypeInfo::DecodableType acFrequency = static_cast(0); - Attributes::AcFrequencyMin::TypeInfo::DecodableType acFrequencyMin = static_cast(0); - Attributes::AcFrequencyMax::TypeInfo::DecodableType acFrequencyMax = static_cast(0); - Attributes::NeutralCurrent::TypeInfo::DecodableType neutralCurrent = static_cast(0); - Attributes::TotalActivePower::TypeInfo::DecodableType totalActivePower = static_cast(0); - Attributes::TotalReactivePower::TypeInfo::DecodableType totalReactivePower = static_cast(0); - Attributes::TotalApparentPower::TypeInfo::DecodableType totalApparentPower = static_cast(0); - Attributes::Measured1stHarmonicCurrent::TypeInfo::DecodableType measured1stHarmonicCurrent = static_cast(0); - Attributes::Measured3rdHarmonicCurrent::TypeInfo::DecodableType measured3rdHarmonicCurrent = static_cast(0); - Attributes::Measured5thHarmonicCurrent::TypeInfo::DecodableType measured5thHarmonicCurrent = static_cast(0); - Attributes::Measured7thHarmonicCurrent::TypeInfo::DecodableType measured7thHarmonicCurrent = static_cast(0); - Attributes::Measured9thHarmonicCurrent::TypeInfo::DecodableType measured9thHarmonicCurrent = static_cast(0); - Attributes::Measured11thHarmonicCurrent::TypeInfo::DecodableType measured11thHarmonicCurrent = static_cast(0); - Attributes::MeasuredPhase1stHarmonicCurrent::TypeInfo::DecodableType measuredPhase1stHarmonicCurrent = - static_cast(0); - Attributes::MeasuredPhase3rdHarmonicCurrent::TypeInfo::DecodableType measuredPhase3rdHarmonicCurrent = - static_cast(0); - Attributes::MeasuredPhase5thHarmonicCurrent::TypeInfo::DecodableType measuredPhase5thHarmonicCurrent = - static_cast(0); - Attributes::MeasuredPhase7thHarmonicCurrent::TypeInfo::DecodableType measuredPhase7thHarmonicCurrent = - static_cast(0); - Attributes::MeasuredPhase9thHarmonicCurrent::TypeInfo::DecodableType measuredPhase9thHarmonicCurrent = - static_cast(0); - Attributes::MeasuredPhase11thHarmonicCurrent::TypeInfo::DecodableType measuredPhase11thHarmonicCurrent = - static_cast(0); - Attributes::AcFrequencyMultiplier::TypeInfo::DecodableType acFrequencyMultiplier = static_cast(0); - Attributes::AcFrequencyDivisor::TypeInfo::DecodableType acFrequencyDivisor = static_cast(0); - Attributes::PowerMultiplier::TypeInfo::DecodableType powerMultiplier = static_cast(0); - Attributes::PowerDivisor::TypeInfo::DecodableType powerDivisor = static_cast(0); - Attributes::HarmonicCurrentMultiplier::TypeInfo::DecodableType harmonicCurrentMultiplier = static_cast(0); - Attributes::PhaseHarmonicCurrentMultiplier::TypeInfo::DecodableType phaseHarmonicCurrentMultiplier = static_cast(0); - Attributes::InstantaneousVoltage::TypeInfo::DecodableType instantaneousVoltage = static_cast(0); - Attributes::InstantaneousLineCurrent::TypeInfo::DecodableType instantaneousLineCurrent = static_cast(0); - Attributes::InstantaneousActiveCurrent::TypeInfo::DecodableType instantaneousActiveCurrent = static_cast(0); - Attributes::InstantaneousReactiveCurrent::TypeInfo::DecodableType instantaneousReactiveCurrent = static_cast(0); - Attributes::InstantaneousPower::TypeInfo::DecodableType instantaneousPower = static_cast(0); - Attributes::RmsVoltage::TypeInfo::DecodableType rmsVoltage = static_cast(0); - Attributes::RmsVoltageMin::TypeInfo::DecodableType rmsVoltageMin = static_cast(0); - Attributes::RmsVoltageMax::TypeInfo::DecodableType rmsVoltageMax = static_cast(0); - Attributes::RmsCurrent::TypeInfo::DecodableType rmsCurrent = static_cast(0); - Attributes::RmsCurrentMin::TypeInfo::DecodableType rmsCurrentMin = static_cast(0); - Attributes::RmsCurrentMax::TypeInfo::DecodableType rmsCurrentMax = static_cast(0); - Attributes::ActivePower::TypeInfo::DecodableType activePower = static_cast(0); - Attributes::ActivePowerMin::TypeInfo::DecodableType activePowerMin = static_cast(0); - Attributes::ActivePowerMax::TypeInfo::DecodableType activePowerMax = static_cast(0); - Attributes::ReactivePower::TypeInfo::DecodableType reactivePower = static_cast(0); - Attributes::ApparentPower::TypeInfo::DecodableType apparentPower = static_cast(0); - Attributes::PowerFactor::TypeInfo::DecodableType powerFactor = static_cast(0); - Attributes::AverageRmsVoltageMeasurementPeriod::TypeInfo::DecodableType averageRmsVoltageMeasurementPeriod = - static_cast(0); - Attributes::AverageRmsUnderVoltageCounter::TypeInfo::DecodableType averageRmsUnderVoltageCounter = static_cast(0); - Attributes::RmsExtremeOverVoltagePeriod::TypeInfo::DecodableType rmsExtremeOverVoltagePeriod = static_cast(0); - Attributes::RmsExtremeUnderVoltagePeriod::TypeInfo::DecodableType rmsExtremeUnderVoltagePeriod = static_cast(0); - Attributes::RmsVoltageSagPeriod::TypeInfo::DecodableType rmsVoltageSagPeriod = static_cast(0); - Attributes::RmsVoltageSwellPeriod::TypeInfo::DecodableType rmsVoltageSwellPeriod = static_cast(0); - Attributes::AcVoltageMultiplier::TypeInfo::DecodableType acVoltageMultiplier = static_cast(0); - Attributes::AcVoltageDivisor::TypeInfo::DecodableType acVoltageDivisor = static_cast(0); - Attributes::AcCurrentMultiplier::TypeInfo::DecodableType acCurrentMultiplier = static_cast(0); - Attributes::AcCurrentDivisor::TypeInfo::DecodableType acCurrentDivisor = static_cast(0); - Attributes::AcPowerMultiplier::TypeInfo::DecodableType acPowerMultiplier = static_cast(0); - Attributes::AcPowerDivisor::TypeInfo::DecodableType acPowerDivisor = static_cast(0); - Attributes::OverloadAlarmsMask::TypeInfo::DecodableType overloadAlarmsMask = static_cast(0); - Attributes::VoltageOverload::TypeInfo::DecodableType voltageOverload = static_cast(0); - Attributes::CurrentOverload::TypeInfo::DecodableType currentOverload = static_cast(0); - Attributes::AcOverloadAlarmsMask::TypeInfo::DecodableType acOverloadAlarmsMask = static_cast(0); - Attributes::AcVoltageOverload::TypeInfo::DecodableType acVoltageOverload = static_cast(0); - Attributes::AcCurrentOverload::TypeInfo::DecodableType acCurrentOverload = static_cast(0); - Attributes::AcActivePowerOverload::TypeInfo::DecodableType acActivePowerOverload = static_cast(0); - Attributes::AcReactivePowerOverload::TypeInfo::DecodableType acReactivePowerOverload = static_cast(0); - Attributes::AverageRmsOverVoltage::TypeInfo::DecodableType averageRmsOverVoltage = static_cast(0); - Attributes::AverageRmsUnderVoltage::TypeInfo::DecodableType averageRmsUnderVoltage = static_cast(0); - Attributes::RmsExtremeOverVoltage::TypeInfo::DecodableType rmsExtremeOverVoltage = static_cast(0); - Attributes::RmsExtremeUnderVoltage::TypeInfo::DecodableType rmsExtremeUnderVoltage = static_cast(0); - Attributes::RmsVoltageSag::TypeInfo::DecodableType rmsVoltageSag = static_cast(0); - Attributes::RmsVoltageSwell::TypeInfo::DecodableType rmsVoltageSwell = static_cast(0); - Attributes::LineCurrentPhaseB::TypeInfo::DecodableType lineCurrentPhaseB = static_cast(0); - Attributes::ActiveCurrentPhaseB::TypeInfo::DecodableType activeCurrentPhaseB = static_cast(0); - Attributes::ReactiveCurrentPhaseB::TypeInfo::DecodableType reactiveCurrentPhaseB = static_cast(0); - Attributes::RmsVoltagePhaseB::TypeInfo::DecodableType rmsVoltagePhaseB = static_cast(0); - Attributes::RmsVoltageMinPhaseB::TypeInfo::DecodableType rmsVoltageMinPhaseB = static_cast(0); - Attributes::RmsVoltageMaxPhaseB::TypeInfo::DecodableType rmsVoltageMaxPhaseB = static_cast(0); - Attributes::RmsCurrentPhaseB::TypeInfo::DecodableType rmsCurrentPhaseB = static_cast(0); - Attributes::RmsCurrentMinPhaseB::TypeInfo::DecodableType rmsCurrentMinPhaseB = static_cast(0); - Attributes::RmsCurrentMaxPhaseB::TypeInfo::DecodableType rmsCurrentMaxPhaseB = static_cast(0); - Attributes::ActivePowerPhaseB::TypeInfo::DecodableType activePowerPhaseB = static_cast(0); - Attributes::ActivePowerMinPhaseB::TypeInfo::DecodableType activePowerMinPhaseB = static_cast(0); - Attributes::ActivePowerMaxPhaseB::TypeInfo::DecodableType activePowerMaxPhaseB = static_cast(0); - Attributes::ReactivePowerPhaseB::TypeInfo::DecodableType reactivePowerPhaseB = static_cast(0); - Attributes::ApparentPowerPhaseB::TypeInfo::DecodableType apparentPowerPhaseB = static_cast(0); - Attributes::PowerFactorPhaseB::TypeInfo::DecodableType powerFactorPhaseB = static_cast(0); - Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::TypeInfo::DecodableType averageRmsVoltageMeasurementPeriodPhaseB = - static_cast(0); - Attributes::AverageRmsOverVoltageCounterPhaseB::TypeInfo::DecodableType averageRmsOverVoltageCounterPhaseB = - static_cast(0); - Attributes::AverageRmsUnderVoltageCounterPhaseB::TypeInfo::DecodableType averageRmsUnderVoltageCounterPhaseB = - static_cast(0); - Attributes::RmsExtremeOverVoltagePeriodPhaseB::TypeInfo::DecodableType rmsExtremeOverVoltagePeriodPhaseB = - static_cast(0); - Attributes::RmsExtremeUnderVoltagePeriodPhaseB::TypeInfo::DecodableType rmsExtremeUnderVoltagePeriodPhaseB = - static_cast(0); - Attributes::RmsVoltageSagPeriodPhaseB::TypeInfo::DecodableType rmsVoltageSagPeriodPhaseB = static_cast(0); - Attributes::RmsVoltageSwellPeriodPhaseB::TypeInfo::DecodableType rmsVoltageSwellPeriodPhaseB = static_cast(0); - Attributes::LineCurrentPhaseC::TypeInfo::DecodableType lineCurrentPhaseC = static_cast(0); - Attributes::ActiveCurrentPhaseC::TypeInfo::DecodableType activeCurrentPhaseC = static_cast(0); - Attributes::ReactiveCurrentPhaseC::TypeInfo::DecodableType reactiveCurrentPhaseC = static_cast(0); - Attributes::RmsVoltagePhaseC::TypeInfo::DecodableType rmsVoltagePhaseC = static_cast(0); - Attributes::RmsVoltageMinPhaseC::TypeInfo::DecodableType rmsVoltageMinPhaseC = static_cast(0); - Attributes::RmsVoltageMaxPhaseC::TypeInfo::DecodableType rmsVoltageMaxPhaseC = static_cast(0); - Attributes::RmsCurrentPhaseC::TypeInfo::DecodableType rmsCurrentPhaseC = static_cast(0); - Attributes::RmsCurrentMinPhaseC::TypeInfo::DecodableType rmsCurrentMinPhaseC = static_cast(0); - Attributes::RmsCurrentMaxPhaseC::TypeInfo::DecodableType rmsCurrentMaxPhaseC = static_cast(0); - Attributes::ActivePowerPhaseC::TypeInfo::DecodableType activePowerPhaseC = static_cast(0); - Attributes::ActivePowerMinPhaseC::TypeInfo::DecodableType activePowerMinPhaseC = static_cast(0); - Attributes::ActivePowerMaxPhaseC::TypeInfo::DecodableType activePowerMaxPhaseC = static_cast(0); - Attributes::ReactivePowerPhaseC::TypeInfo::DecodableType reactivePowerPhaseC = static_cast(0); - Attributes::ApparentPowerPhaseC::TypeInfo::DecodableType apparentPowerPhaseC = static_cast(0); - Attributes::PowerFactorPhaseC::TypeInfo::DecodableType powerFactorPhaseC = static_cast(0); - Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::TypeInfo::DecodableType averageRmsVoltageMeasurementPeriodPhaseC = - static_cast(0); - Attributes::AverageRmsOverVoltageCounterPhaseC::TypeInfo::DecodableType averageRmsOverVoltageCounterPhaseC = - static_cast(0); - Attributes::AverageRmsUnderVoltageCounterPhaseC::TypeInfo::DecodableType averageRmsUnderVoltageCounterPhaseC = - static_cast(0); - Attributes::RmsExtremeOverVoltagePeriodPhaseC::TypeInfo::DecodableType rmsExtremeOverVoltagePeriodPhaseC = - static_cast(0); - Attributes::RmsExtremeUnderVoltagePeriodPhaseC::TypeInfo::DecodableType rmsExtremeUnderVoltagePeriodPhaseC = - static_cast(0); - Attributes::RmsVoltageSagPeriodPhaseC::TypeInfo::DecodableType rmsVoltageSagPeriodPhaseC = static_cast(0); - Attributes::RmsVoltageSwellPeriodPhaseC::TypeInfo::DecodableType rmsVoltageSwellPeriodPhaseC = static_cast(0); - Attributes::GeneratedCommandList::TypeInfo::DecodableType generatedCommandList; - Attributes::AcceptedCommandList::TypeInfo::DecodableType acceptedCommandList; - Attributes::EventList::TypeInfo::DecodableType eventList; - Attributes::AttributeList::TypeInfo::DecodableType attributeList; - Attributes::FeatureMap::TypeInfo::DecodableType featureMap = static_cast(0); - Attributes::ClusterRevision::TypeInfo::DecodableType clusterRevision = static_cast(0); - }; -}; -} // namespace Attributes -} // namespace ElectricalMeasurement namespace UnitTesting { namespace Structs { namespace SimpleStruct { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h index 6e19a4c970df77..20e4ea7c9fd82a 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Attributes.h @@ -177,44 +177,6 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace OnOff -namespace OnOffSwitchConfiguration { -namespace Attributes { - -namespace SwitchType { -static constexpr AttributeId Id = 0x00000000; -} // namespace SwitchType - -namespace SwitchActions { -static constexpr AttributeId Id = 0x00000010; -} // namespace SwitchActions - -namespace GeneratedCommandList { -static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; -} // namespace GeneratedCommandList - -namespace AcceptedCommandList { -static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; -} // namespace AcceptedCommandList - -namespace EventList { -static constexpr AttributeId Id = Globals::Attributes::EventList::Id; -} // namespace EventList - -namespace AttributeList { -static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; -} // namespace AttributeList - -namespace FeatureMap { -static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; -} // namespace FeatureMap - -namespace ClusterRevision { -static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace OnOffSwitchConfiguration - namespace LevelControl { namespace Attributes { @@ -301,72 +263,6 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace LevelControl -namespace BinaryInputBasic { -namespace Attributes { - -namespace ActiveText { -static constexpr AttributeId Id = 0x00000004; -} // namespace ActiveText - -namespace Description { -static constexpr AttributeId Id = 0x0000001C; -} // namespace Description - -namespace InactiveText { -static constexpr AttributeId Id = 0x0000002E; -} // namespace InactiveText - -namespace OutOfService { -static constexpr AttributeId Id = 0x00000051; -} // namespace OutOfService - -namespace Polarity { -static constexpr AttributeId Id = 0x00000054; -} // namespace Polarity - -namespace PresentValue { -static constexpr AttributeId Id = 0x00000055; -} // namespace PresentValue - -namespace Reliability { -static constexpr AttributeId Id = 0x00000067; -} // namespace Reliability - -namespace StatusFlags { -static constexpr AttributeId Id = 0x0000006F; -} // namespace StatusFlags - -namespace ApplicationType { -static constexpr AttributeId Id = 0x00000100; -} // namespace ApplicationType - -namespace GeneratedCommandList { -static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; -} // namespace GeneratedCommandList - -namespace AcceptedCommandList { -static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; -} // namespace AcceptedCommandList - -namespace EventList { -static constexpr AttributeId Id = Globals::Attributes::EventList::Id; -} // namespace EventList - -namespace AttributeList { -static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; -} // namespace AttributeList - -namespace FeatureMap { -static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; -} // namespace FeatureMap - -namespace ClusterRevision { -static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace BinaryInputBasic - namespace PulseWidthModulation { namespace Attributes { @@ -4725,76 +4621,6 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace WindowCovering -namespace BarrierControl { -namespace Attributes { - -namespace BarrierMovingState { -static constexpr AttributeId Id = 0x00000001; -} // namespace BarrierMovingState - -namespace BarrierSafetyStatus { -static constexpr AttributeId Id = 0x00000002; -} // namespace BarrierSafetyStatus - -namespace BarrierCapabilities { -static constexpr AttributeId Id = 0x00000003; -} // namespace BarrierCapabilities - -namespace BarrierOpenEvents { -static constexpr AttributeId Id = 0x00000004; -} // namespace BarrierOpenEvents - -namespace BarrierCloseEvents { -static constexpr AttributeId Id = 0x00000005; -} // namespace BarrierCloseEvents - -namespace BarrierCommandOpenEvents { -static constexpr AttributeId Id = 0x00000006; -} // namespace BarrierCommandOpenEvents - -namespace BarrierCommandCloseEvents { -static constexpr AttributeId Id = 0x00000007; -} // namespace BarrierCommandCloseEvents - -namespace BarrierOpenPeriod { -static constexpr AttributeId Id = 0x00000008; -} // namespace BarrierOpenPeriod - -namespace BarrierClosePeriod { -static constexpr AttributeId Id = 0x00000009; -} // namespace BarrierClosePeriod - -namespace BarrierPosition { -static constexpr AttributeId Id = 0x0000000A; -} // namespace BarrierPosition - -namespace GeneratedCommandList { -static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; -} // namespace GeneratedCommandList - -namespace AcceptedCommandList { -static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; -} // namespace AcceptedCommandList - -namespace EventList { -static constexpr AttributeId Id = Globals::Attributes::EventList::Id; -} // namespace EventList - -namespace AttributeList { -static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; -} // namespace AttributeList - -namespace FeatureMap { -static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; -} // namespace FeatureMap - -namespace ClusterRevision { -static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace BarrierControl - namespace ServiceArea { namespace Attributes { @@ -7559,548 +7385,6 @@ static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; } // namespace Attributes } // namespace CommissionerControl -namespace ElectricalMeasurement { -namespace Attributes { - -namespace MeasurementType { -static constexpr AttributeId Id = 0x00000000; -} // namespace MeasurementType - -namespace DcVoltage { -static constexpr AttributeId Id = 0x00000100; -} // namespace DcVoltage - -namespace DcVoltageMin { -static constexpr AttributeId Id = 0x00000101; -} // namespace DcVoltageMin - -namespace DcVoltageMax { -static constexpr AttributeId Id = 0x00000102; -} // namespace DcVoltageMax - -namespace DcCurrent { -static constexpr AttributeId Id = 0x00000103; -} // namespace DcCurrent - -namespace DcCurrentMin { -static constexpr AttributeId Id = 0x00000104; -} // namespace DcCurrentMin - -namespace DcCurrentMax { -static constexpr AttributeId Id = 0x00000105; -} // namespace DcCurrentMax - -namespace DcPower { -static constexpr AttributeId Id = 0x00000106; -} // namespace DcPower - -namespace DcPowerMin { -static constexpr AttributeId Id = 0x00000107; -} // namespace DcPowerMin - -namespace DcPowerMax { -static constexpr AttributeId Id = 0x00000108; -} // namespace DcPowerMax - -namespace DcVoltageMultiplier { -static constexpr AttributeId Id = 0x00000200; -} // namespace DcVoltageMultiplier - -namespace DcVoltageDivisor { -static constexpr AttributeId Id = 0x00000201; -} // namespace DcVoltageDivisor - -namespace DcCurrentMultiplier { -static constexpr AttributeId Id = 0x00000202; -} // namespace DcCurrentMultiplier - -namespace DcCurrentDivisor { -static constexpr AttributeId Id = 0x00000203; -} // namespace DcCurrentDivisor - -namespace DcPowerMultiplier { -static constexpr AttributeId Id = 0x00000204; -} // namespace DcPowerMultiplier - -namespace DcPowerDivisor { -static constexpr AttributeId Id = 0x00000205; -} // namespace DcPowerDivisor - -namespace AcFrequency { -static constexpr AttributeId Id = 0x00000300; -} // namespace AcFrequency - -namespace AcFrequencyMin { -static constexpr AttributeId Id = 0x00000301; -} // namespace AcFrequencyMin - -namespace AcFrequencyMax { -static constexpr AttributeId Id = 0x00000302; -} // namespace AcFrequencyMax - -namespace NeutralCurrent { -static constexpr AttributeId Id = 0x00000303; -} // namespace NeutralCurrent - -namespace TotalActivePower { -static constexpr AttributeId Id = 0x00000304; -} // namespace TotalActivePower - -namespace TotalReactivePower { -static constexpr AttributeId Id = 0x00000305; -} // namespace TotalReactivePower - -namespace TotalApparentPower { -static constexpr AttributeId Id = 0x00000306; -} // namespace TotalApparentPower - -namespace Measured1stHarmonicCurrent { -static constexpr AttributeId Id = 0x00000307; -} // namespace Measured1stHarmonicCurrent - -namespace Measured3rdHarmonicCurrent { -static constexpr AttributeId Id = 0x00000308; -} // namespace Measured3rdHarmonicCurrent - -namespace Measured5thHarmonicCurrent { -static constexpr AttributeId Id = 0x00000309; -} // namespace Measured5thHarmonicCurrent - -namespace Measured7thHarmonicCurrent { -static constexpr AttributeId Id = 0x0000030A; -} // namespace Measured7thHarmonicCurrent - -namespace Measured9thHarmonicCurrent { -static constexpr AttributeId Id = 0x0000030B; -} // namespace Measured9thHarmonicCurrent - -namespace Measured11thHarmonicCurrent { -static constexpr AttributeId Id = 0x0000030C; -} // namespace Measured11thHarmonicCurrent - -namespace MeasuredPhase1stHarmonicCurrent { -static constexpr AttributeId Id = 0x0000030D; -} // namespace MeasuredPhase1stHarmonicCurrent - -namespace MeasuredPhase3rdHarmonicCurrent { -static constexpr AttributeId Id = 0x0000030E; -} // namespace MeasuredPhase3rdHarmonicCurrent - -namespace MeasuredPhase5thHarmonicCurrent { -static constexpr AttributeId Id = 0x0000030F; -} // namespace MeasuredPhase5thHarmonicCurrent - -namespace MeasuredPhase7thHarmonicCurrent { -static constexpr AttributeId Id = 0x00000310; -} // namespace MeasuredPhase7thHarmonicCurrent - -namespace MeasuredPhase9thHarmonicCurrent { -static constexpr AttributeId Id = 0x00000311; -} // namespace MeasuredPhase9thHarmonicCurrent - -namespace MeasuredPhase11thHarmonicCurrent { -static constexpr AttributeId Id = 0x00000312; -} // namespace MeasuredPhase11thHarmonicCurrent - -namespace AcFrequencyMultiplier { -static constexpr AttributeId Id = 0x00000400; -} // namespace AcFrequencyMultiplier - -namespace AcFrequencyDivisor { -static constexpr AttributeId Id = 0x00000401; -} // namespace AcFrequencyDivisor - -namespace PowerMultiplier { -static constexpr AttributeId Id = 0x00000402; -} // namespace PowerMultiplier - -namespace PowerDivisor { -static constexpr AttributeId Id = 0x00000403; -} // namespace PowerDivisor - -namespace HarmonicCurrentMultiplier { -static constexpr AttributeId Id = 0x00000404; -} // namespace HarmonicCurrentMultiplier - -namespace PhaseHarmonicCurrentMultiplier { -static constexpr AttributeId Id = 0x00000405; -} // namespace PhaseHarmonicCurrentMultiplier - -namespace InstantaneousVoltage { -static constexpr AttributeId Id = 0x00000500; -} // namespace InstantaneousVoltage - -namespace InstantaneousLineCurrent { -static constexpr AttributeId Id = 0x00000501; -} // namespace InstantaneousLineCurrent - -namespace InstantaneousActiveCurrent { -static constexpr AttributeId Id = 0x00000502; -} // namespace InstantaneousActiveCurrent - -namespace InstantaneousReactiveCurrent { -static constexpr AttributeId Id = 0x00000503; -} // namespace InstantaneousReactiveCurrent - -namespace InstantaneousPower { -static constexpr AttributeId Id = 0x00000504; -} // namespace InstantaneousPower - -namespace RmsVoltage { -static constexpr AttributeId Id = 0x00000505; -} // namespace RmsVoltage - -namespace RmsVoltageMin { -static constexpr AttributeId Id = 0x00000506; -} // namespace RmsVoltageMin - -namespace RmsVoltageMax { -static constexpr AttributeId Id = 0x00000507; -} // namespace RmsVoltageMax - -namespace RmsCurrent { -static constexpr AttributeId Id = 0x00000508; -} // namespace RmsCurrent - -namespace RmsCurrentMin { -static constexpr AttributeId Id = 0x00000509; -} // namespace RmsCurrentMin - -namespace RmsCurrentMax { -static constexpr AttributeId Id = 0x0000050A; -} // namespace RmsCurrentMax - -namespace ActivePower { -static constexpr AttributeId Id = 0x0000050B; -} // namespace ActivePower - -namespace ActivePowerMin { -static constexpr AttributeId Id = 0x0000050C; -} // namespace ActivePowerMin - -namespace ActivePowerMax { -static constexpr AttributeId Id = 0x0000050D; -} // namespace ActivePowerMax - -namespace ReactivePower { -static constexpr AttributeId Id = 0x0000050E; -} // namespace ReactivePower - -namespace ApparentPower { -static constexpr AttributeId Id = 0x0000050F; -} // namespace ApparentPower - -namespace PowerFactor { -static constexpr AttributeId Id = 0x00000510; -} // namespace PowerFactor - -namespace AverageRmsVoltageMeasurementPeriod { -static constexpr AttributeId Id = 0x00000511; -} // namespace AverageRmsVoltageMeasurementPeriod - -namespace AverageRmsUnderVoltageCounter { -static constexpr AttributeId Id = 0x00000513; -} // namespace AverageRmsUnderVoltageCounter - -namespace RmsExtremeOverVoltagePeriod { -static constexpr AttributeId Id = 0x00000514; -} // namespace RmsExtremeOverVoltagePeriod - -namespace RmsExtremeUnderVoltagePeriod { -static constexpr AttributeId Id = 0x00000515; -} // namespace RmsExtremeUnderVoltagePeriod - -namespace RmsVoltageSagPeriod { -static constexpr AttributeId Id = 0x00000516; -} // namespace RmsVoltageSagPeriod - -namespace RmsVoltageSwellPeriod { -static constexpr AttributeId Id = 0x00000517; -} // namespace RmsVoltageSwellPeriod - -namespace AcVoltageMultiplier { -static constexpr AttributeId Id = 0x00000600; -} // namespace AcVoltageMultiplier - -namespace AcVoltageDivisor { -static constexpr AttributeId Id = 0x00000601; -} // namespace AcVoltageDivisor - -namespace AcCurrentMultiplier { -static constexpr AttributeId Id = 0x00000602; -} // namespace AcCurrentMultiplier - -namespace AcCurrentDivisor { -static constexpr AttributeId Id = 0x00000603; -} // namespace AcCurrentDivisor - -namespace AcPowerMultiplier { -static constexpr AttributeId Id = 0x00000604; -} // namespace AcPowerMultiplier - -namespace AcPowerDivisor { -static constexpr AttributeId Id = 0x00000605; -} // namespace AcPowerDivisor - -namespace OverloadAlarmsMask { -static constexpr AttributeId Id = 0x00000700; -} // namespace OverloadAlarmsMask - -namespace VoltageOverload { -static constexpr AttributeId Id = 0x00000701; -} // namespace VoltageOverload - -namespace CurrentOverload { -static constexpr AttributeId Id = 0x00000702; -} // namespace CurrentOverload - -namespace AcOverloadAlarmsMask { -static constexpr AttributeId Id = 0x00000800; -} // namespace AcOverloadAlarmsMask - -namespace AcVoltageOverload { -static constexpr AttributeId Id = 0x00000801; -} // namespace AcVoltageOverload - -namespace AcCurrentOverload { -static constexpr AttributeId Id = 0x00000802; -} // namespace AcCurrentOverload - -namespace AcActivePowerOverload { -static constexpr AttributeId Id = 0x00000803; -} // namespace AcActivePowerOverload - -namespace AcReactivePowerOverload { -static constexpr AttributeId Id = 0x00000804; -} // namespace AcReactivePowerOverload - -namespace AverageRmsOverVoltage { -static constexpr AttributeId Id = 0x00000805; -} // namespace AverageRmsOverVoltage - -namespace AverageRmsUnderVoltage { -static constexpr AttributeId Id = 0x00000806; -} // namespace AverageRmsUnderVoltage - -namespace RmsExtremeOverVoltage { -static constexpr AttributeId Id = 0x00000807; -} // namespace RmsExtremeOverVoltage - -namespace RmsExtremeUnderVoltage { -static constexpr AttributeId Id = 0x00000808; -} // namespace RmsExtremeUnderVoltage - -namespace RmsVoltageSag { -static constexpr AttributeId Id = 0x00000809; -} // namespace RmsVoltageSag - -namespace RmsVoltageSwell { -static constexpr AttributeId Id = 0x0000080A; -} // namespace RmsVoltageSwell - -namespace LineCurrentPhaseB { -static constexpr AttributeId Id = 0x00000901; -} // namespace LineCurrentPhaseB - -namespace ActiveCurrentPhaseB { -static constexpr AttributeId Id = 0x00000902; -} // namespace ActiveCurrentPhaseB - -namespace ReactiveCurrentPhaseB { -static constexpr AttributeId Id = 0x00000903; -} // namespace ReactiveCurrentPhaseB - -namespace RmsVoltagePhaseB { -static constexpr AttributeId Id = 0x00000905; -} // namespace RmsVoltagePhaseB - -namespace RmsVoltageMinPhaseB { -static constexpr AttributeId Id = 0x00000906; -} // namespace RmsVoltageMinPhaseB - -namespace RmsVoltageMaxPhaseB { -static constexpr AttributeId Id = 0x00000907; -} // namespace RmsVoltageMaxPhaseB - -namespace RmsCurrentPhaseB { -static constexpr AttributeId Id = 0x00000908; -} // namespace RmsCurrentPhaseB - -namespace RmsCurrentMinPhaseB { -static constexpr AttributeId Id = 0x00000909; -} // namespace RmsCurrentMinPhaseB - -namespace RmsCurrentMaxPhaseB { -static constexpr AttributeId Id = 0x0000090A; -} // namespace RmsCurrentMaxPhaseB - -namespace ActivePowerPhaseB { -static constexpr AttributeId Id = 0x0000090B; -} // namespace ActivePowerPhaseB - -namespace ActivePowerMinPhaseB { -static constexpr AttributeId Id = 0x0000090C; -} // namespace ActivePowerMinPhaseB - -namespace ActivePowerMaxPhaseB { -static constexpr AttributeId Id = 0x0000090D; -} // namespace ActivePowerMaxPhaseB - -namespace ReactivePowerPhaseB { -static constexpr AttributeId Id = 0x0000090E; -} // namespace ReactivePowerPhaseB - -namespace ApparentPowerPhaseB { -static constexpr AttributeId Id = 0x0000090F; -} // namespace ApparentPowerPhaseB - -namespace PowerFactorPhaseB { -static constexpr AttributeId Id = 0x00000910; -} // namespace PowerFactorPhaseB - -namespace AverageRmsVoltageMeasurementPeriodPhaseB { -static constexpr AttributeId Id = 0x00000911; -} // namespace AverageRmsVoltageMeasurementPeriodPhaseB - -namespace AverageRmsOverVoltageCounterPhaseB { -static constexpr AttributeId Id = 0x00000912; -} // namespace AverageRmsOverVoltageCounterPhaseB - -namespace AverageRmsUnderVoltageCounterPhaseB { -static constexpr AttributeId Id = 0x00000913; -} // namespace AverageRmsUnderVoltageCounterPhaseB - -namespace RmsExtremeOverVoltagePeriodPhaseB { -static constexpr AttributeId Id = 0x00000914; -} // namespace RmsExtremeOverVoltagePeriodPhaseB - -namespace RmsExtremeUnderVoltagePeriodPhaseB { -static constexpr AttributeId Id = 0x00000915; -} // namespace RmsExtremeUnderVoltagePeriodPhaseB - -namespace RmsVoltageSagPeriodPhaseB { -static constexpr AttributeId Id = 0x00000916; -} // namespace RmsVoltageSagPeriodPhaseB - -namespace RmsVoltageSwellPeriodPhaseB { -static constexpr AttributeId Id = 0x00000917; -} // namespace RmsVoltageSwellPeriodPhaseB - -namespace LineCurrentPhaseC { -static constexpr AttributeId Id = 0x00000A01; -} // namespace LineCurrentPhaseC - -namespace ActiveCurrentPhaseC { -static constexpr AttributeId Id = 0x00000A02; -} // namespace ActiveCurrentPhaseC - -namespace ReactiveCurrentPhaseC { -static constexpr AttributeId Id = 0x00000A03; -} // namespace ReactiveCurrentPhaseC - -namespace RmsVoltagePhaseC { -static constexpr AttributeId Id = 0x00000A05; -} // namespace RmsVoltagePhaseC - -namespace RmsVoltageMinPhaseC { -static constexpr AttributeId Id = 0x00000A06; -} // namespace RmsVoltageMinPhaseC - -namespace RmsVoltageMaxPhaseC { -static constexpr AttributeId Id = 0x00000A07; -} // namespace RmsVoltageMaxPhaseC - -namespace RmsCurrentPhaseC { -static constexpr AttributeId Id = 0x00000A08; -} // namespace RmsCurrentPhaseC - -namespace RmsCurrentMinPhaseC { -static constexpr AttributeId Id = 0x00000A09; -} // namespace RmsCurrentMinPhaseC - -namespace RmsCurrentMaxPhaseC { -static constexpr AttributeId Id = 0x00000A0A; -} // namespace RmsCurrentMaxPhaseC - -namespace ActivePowerPhaseC { -static constexpr AttributeId Id = 0x00000A0B; -} // namespace ActivePowerPhaseC - -namespace ActivePowerMinPhaseC { -static constexpr AttributeId Id = 0x00000A0C; -} // namespace ActivePowerMinPhaseC - -namespace ActivePowerMaxPhaseC { -static constexpr AttributeId Id = 0x00000A0D; -} // namespace ActivePowerMaxPhaseC - -namespace ReactivePowerPhaseC { -static constexpr AttributeId Id = 0x00000A0E; -} // namespace ReactivePowerPhaseC - -namespace ApparentPowerPhaseC { -static constexpr AttributeId Id = 0x00000A0F; -} // namespace ApparentPowerPhaseC - -namespace PowerFactorPhaseC { -static constexpr AttributeId Id = 0x00000A10; -} // namespace PowerFactorPhaseC - -namespace AverageRmsVoltageMeasurementPeriodPhaseC { -static constexpr AttributeId Id = 0x00000A11; -} // namespace AverageRmsVoltageMeasurementPeriodPhaseC - -namespace AverageRmsOverVoltageCounterPhaseC { -static constexpr AttributeId Id = 0x00000A12; -} // namespace AverageRmsOverVoltageCounterPhaseC - -namespace AverageRmsUnderVoltageCounterPhaseC { -static constexpr AttributeId Id = 0x00000A13; -} // namespace AverageRmsUnderVoltageCounterPhaseC - -namespace RmsExtremeOverVoltagePeriodPhaseC { -static constexpr AttributeId Id = 0x00000A14; -} // namespace RmsExtremeOverVoltagePeriodPhaseC - -namespace RmsExtremeUnderVoltagePeriodPhaseC { -static constexpr AttributeId Id = 0x00000A15; -} // namespace RmsExtremeUnderVoltagePeriodPhaseC - -namespace RmsVoltageSagPeriodPhaseC { -static constexpr AttributeId Id = 0x00000A16; -} // namespace RmsVoltageSagPeriodPhaseC - -namespace RmsVoltageSwellPeriodPhaseC { -static constexpr AttributeId Id = 0x00000A17; -} // namespace RmsVoltageSwellPeriodPhaseC - -namespace GeneratedCommandList { -static constexpr AttributeId Id = Globals::Attributes::GeneratedCommandList::Id; -} // namespace GeneratedCommandList - -namespace AcceptedCommandList { -static constexpr AttributeId Id = Globals::Attributes::AcceptedCommandList::Id; -} // namespace AcceptedCommandList - -namespace EventList { -static constexpr AttributeId Id = Globals::Attributes::EventList::Id; -} // namespace EventList - -namespace AttributeList { -static constexpr AttributeId Id = Globals::Attributes::AttributeList::Id; -} // namespace AttributeList - -namespace FeatureMap { -static constexpr AttributeId Id = Globals::Attributes::FeatureMap::Id; -} // namespace FeatureMap - -namespace ClusterRevision { -static constexpr AttributeId Id = Globals::Attributes::ClusterRevision::Id; -} // namespace ClusterRevision - -} // namespace Attributes -} // namespace ElectricalMeasurement - namespace UnitTesting { namespace Attributes { diff --git a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h index 9e5bb87b52ef51..26dd82c18e704e 100644 --- a/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h +++ b/zzz_generated/app-common/app-common/zap-generated/ids/Clusters.h @@ -34,15 +34,9 @@ static constexpr ClusterId Id = 0x00000004; namespace OnOff { static constexpr ClusterId Id = 0x00000006; } // namespace OnOff -namespace OnOffSwitchConfiguration { -static constexpr ClusterId Id = 0x00000007; -} // namespace OnOffSwitchConfiguration namespace LevelControl { static constexpr ClusterId Id = 0x00000008; } // namespace LevelControl -namespace BinaryInputBasic { -static constexpr ClusterId Id = 0x0000000F; -} // namespace BinaryInputBasic namespace PulseWidthModulation { static constexpr ClusterId Id = 0x0000001C; } // namespace PulseWidthModulation @@ -262,9 +256,6 @@ static constexpr ClusterId Id = 0x00000101; namespace WindowCovering { static constexpr ClusterId Id = 0x00000102; } // namespace WindowCovering -namespace BarrierControl { -static constexpr ClusterId Id = 0x00000103; -} // namespace BarrierControl namespace ServiceArea { static constexpr ClusterId Id = 0x00000150; } // namespace ServiceArea @@ -391,9 +382,6 @@ static constexpr ClusterId Id = 0x00000750; namespace CommissionerControl { static constexpr ClusterId Id = 0x00000751; } // namespace CommissionerControl -namespace ElectricalMeasurement { -static constexpr ClusterId Id = 0x00000B04; -} // namespace ElectricalMeasurement namespace UnitTesting { static constexpr ClusterId Id = 0xFFF1FC05; } // namespace UnitTesting 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 36ff7b0f098911..b6cd8158f07d94 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 @@ -1281,20 +1281,6 @@ static constexpr CommandId Id = 0x00000008; } // namespace Commands } // namespace WindowCovering -namespace BarrierControl { -namespace Commands { - -namespace BarrierControlGoToPercent { -static constexpr CommandId Id = 0x00000000; -} // namespace BarrierControlGoToPercent - -namespace BarrierControlStop { -static constexpr CommandId Id = 0x00000001; -} // namespace BarrierControlStop - -} // namespace Commands -} // namespace BarrierControl - namespace ServiceArea { namespace Commands { @@ -1835,28 +1821,6 @@ static constexpr CommandId Id = 0x00000002; } // namespace Commands } // namespace CommissionerControl -namespace ElectricalMeasurement { -namespace Commands { - -namespace GetProfileInfoResponseCommand { -static constexpr CommandId Id = 0x00000000; -} // namespace GetProfileInfoResponseCommand - -namespace GetProfileInfoCommand { -static constexpr CommandId Id = 0x00000000; -} // namespace GetProfileInfoCommand - -namespace GetMeasurementProfileResponseCommand { -static constexpr CommandId Id = 0x00000001; -} // namespace GetMeasurementProfileResponseCommand - -namespace GetMeasurementProfileCommand { -static constexpr CommandId Id = 0x00000001; -} // namespace GetMeasurementProfileCommand - -} // namespace Commands -} // namespace ElectricalMeasurement - namespace UnitTesting { namespace Commands { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h index c01a3135dc46bd..2333130d16c13a 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/Commands.h @@ -38,9 +38,7 @@ | Identify | 0x0003 | | Groups | 0x0004 | | OnOff | 0x0006 | -| OnOffSwitchConfiguration | 0x0007 | | LevelControl | 0x0008 | -| BinaryInputBasic | 0x000F | | PulseWidthModulation | 0x001C | | Descriptor | 0x001D | | Binding | 0x001E | @@ -114,7 +112,6 @@ | DeviceEnergyManagementMode | 0x009F | | DoorLock | 0x0101 | | WindowCovering | 0x0102 | -| BarrierControl | 0x0103 | | ServiceArea | 0x0150 | | PumpConfigurationAndControl | 0x0200 | | Thermostat | 0x0201 | @@ -157,7 +154,6 @@ | ContentAppObserver | 0x0510 | | EcosystemInformation | 0x0750 | | CommissionerControl | 0x0751 | -| ElectricalMeasurement | 0x0B04 | | UnitTesting | 0xFFF1FC05| | FaultInjection | 0xFFF1FC06| | SampleMei | 0xFFF1FC20| @@ -756,24 +752,6 @@ class OnOffOnWithTimedOff : public ClusterCommand chip::app::Clusters::OnOff::Commands::OnWithTimedOff::Type mRequest; }; -/*----------------------------------------------------------------------------*\ -| Cluster OnOffSwitchConfiguration | 0x0007 | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * SwitchType | 0x0000 | -| * SwitchActions | 0x0010 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * EventList | 0xFFFA | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /*----------------------------------------------------------------------------*\ | Cluster LevelControl | 0x0008 | |------------------------------------------------------------------------------| @@ -1170,31 +1148,6 @@ class LevelControlMoveToClosestFrequency : public ClusterCommand chip::app::Clusters::LevelControl::Commands::MoveToClosestFrequency::Type mRequest; }; -/*----------------------------------------------------------------------------*\ -| Cluster BinaryInputBasic | 0x000F | -|------------------------------------------------------------------------------| -| Commands: | | -|------------------------------------------------------------------------------| -| Attributes: | | -| * ActiveText | 0x0004 | -| * Description | 0x001C | -| * InactiveText | 0x002E | -| * OutOfService | 0x0051 | -| * Polarity | 0x0054 | -| * PresentValue | 0x0055 | -| * Reliability | 0x0067 | -| * StatusFlags | 0x006F | -| * ApplicationType | 0x0100 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * EventList | 0xFFFA | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - /*----------------------------------------------------------------------------*\ | Cluster PulseWidthModulation | 0x001C | |------------------------------------------------------------------------------| @@ -9254,109 +9207,6 @@ class WindowCoveringGoToTiltPercentage : public ClusterCommand chip::app::Clusters::WindowCovering::Commands::GoToTiltPercentage::Type mRequest; }; -/*----------------------------------------------------------------------------*\ -| Cluster BarrierControl | 0x0103 | -|------------------------------------------------------------------------------| -| Commands: | | -| * BarrierControlGoToPercent | 0x00 | -| * BarrierControlStop | 0x01 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * BarrierMovingState | 0x0001 | -| * BarrierSafetyStatus | 0x0002 | -| * BarrierCapabilities | 0x0003 | -| * BarrierOpenEvents | 0x0004 | -| * BarrierCloseEvents | 0x0005 | -| * BarrierCommandOpenEvents | 0x0006 | -| * BarrierCommandCloseEvents | 0x0007 | -| * BarrierOpenPeriod | 0x0008 | -| * BarrierClosePeriod | 0x0009 | -| * BarrierPosition | 0x000A | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * EventList | 0xFFFA | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command BarrierControlGoToPercent - */ -class BarrierControlBarrierControlGoToPercent : public ClusterCommand -{ -public: - BarrierControlBarrierControlGoToPercent(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("barrier-control-go-to-percent", credsIssuerConfig) - { - AddArgument("PercentOpen", 0, UINT8_MAX, &mRequest.percentOpen); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::BarrierControl::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::BarrierControl::Commands::BarrierControlGoToPercent::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, - commandId, endpointIds.at(0)); - return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::BarrierControl::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::BarrierControl::Commands::BarrierControlGoToPercent::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, - groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); - } - -private: - chip::app::Clusters::BarrierControl::Commands::BarrierControlGoToPercent::Type mRequest; -}; - -/* - * Command BarrierControlStop - */ -class BarrierControlBarrierControlStop : public ClusterCommand -{ -public: - BarrierControlBarrierControlStop(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("barrier-control-stop", credsIssuerConfig) - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::BarrierControl::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::BarrierControl::Commands::BarrierControlStop::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, - commandId, endpointIds.at(0)); - return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::BarrierControl::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::BarrierControl::Commands::BarrierControlStop::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, - groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); - } - -private: - chip::app::Clusters::BarrierControl::Commands::BarrierControlStop::Type mRequest; -}; - /*----------------------------------------------------------------------------*\ | Cluster ServiceArea | 0x0150 | |------------------------------------------------------------------------------| @@ -13913,231 +13763,6 @@ class CommissionerControlCommissionNode : public ClusterCommand chip::app::Clusters::CommissionerControl::Commands::CommissionNode::Type mRequest; }; -/*----------------------------------------------------------------------------*\ -| Cluster ElectricalMeasurement | 0x0B04 | -|------------------------------------------------------------------------------| -| Commands: | | -| * GetProfileInfoCommand | 0x00 | -| * GetMeasurementProfileCommand | 0x01 | -|------------------------------------------------------------------------------| -| Attributes: | | -| * MeasurementType | 0x0000 | -| * DcVoltage | 0x0100 | -| * DcVoltageMin | 0x0101 | -| * DcVoltageMax | 0x0102 | -| * DcCurrent | 0x0103 | -| * DcCurrentMin | 0x0104 | -| * DcCurrentMax | 0x0105 | -| * DcPower | 0x0106 | -| * DcPowerMin | 0x0107 | -| * DcPowerMax | 0x0108 | -| * DcVoltageMultiplier | 0x0200 | -| * DcVoltageDivisor | 0x0201 | -| * DcCurrentMultiplier | 0x0202 | -| * DcCurrentDivisor | 0x0203 | -| * DcPowerMultiplier | 0x0204 | -| * DcPowerDivisor | 0x0205 | -| * AcFrequency | 0x0300 | -| * AcFrequencyMin | 0x0301 | -| * AcFrequencyMax | 0x0302 | -| * NeutralCurrent | 0x0303 | -| * TotalActivePower | 0x0304 | -| * TotalReactivePower | 0x0305 | -| * TotalApparentPower | 0x0306 | -| * Measured1stHarmonicCurrent | 0x0307 | -| * Measured3rdHarmonicCurrent | 0x0308 | -| * Measured5thHarmonicCurrent | 0x0309 | -| * Measured7thHarmonicCurrent | 0x030A | -| * Measured9thHarmonicCurrent | 0x030B | -| * Measured11thHarmonicCurrent | 0x030C | -| * MeasuredPhase1stHarmonicCurrent | 0x030D | -| * MeasuredPhase3rdHarmonicCurrent | 0x030E | -| * MeasuredPhase5thHarmonicCurrent | 0x030F | -| * MeasuredPhase7thHarmonicCurrent | 0x0310 | -| * MeasuredPhase9thHarmonicCurrent | 0x0311 | -| * MeasuredPhase11thHarmonicCurrent | 0x0312 | -| * AcFrequencyMultiplier | 0x0400 | -| * AcFrequencyDivisor | 0x0401 | -| * PowerMultiplier | 0x0402 | -| * PowerDivisor | 0x0403 | -| * HarmonicCurrentMultiplier | 0x0404 | -| * PhaseHarmonicCurrentMultiplier | 0x0405 | -| * InstantaneousVoltage | 0x0500 | -| * InstantaneousLineCurrent | 0x0501 | -| * InstantaneousActiveCurrent | 0x0502 | -| * InstantaneousReactiveCurrent | 0x0503 | -| * InstantaneousPower | 0x0504 | -| * RmsVoltage | 0x0505 | -| * RmsVoltageMin | 0x0506 | -| * RmsVoltageMax | 0x0507 | -| * RmsCurrent | 0x0508 | -| * RmsCurrentMin | 0x0509 | -| * RmsCurrentMax | 0x050A | -| * ActivePower | 0x050B | -| * ActivePowerMin | 0x050C | -| * ActivePowerMax | 0x050D | -| * ReactivePower | 0x050E | -| * ApparentPower | 0x050F | -| * PowerFactor | 0x0510 | -| * AverageRmsVoltageMeasurementPeriod | 0x0511 | -| * AverageRmsUnderVoltageCounter | 0x0513 | -| * RmsExtremeOverVoltagePeriod | 0x0514 | -| * RmsExtremeUnderVoltagePeriod | 0x0515 | -| * RmsVoltageSagPeriod | 0x0516 | -| * RmsVoltageSwellPeriod | 0x0517 | -| * AcVoltageMultiplier | 0x0600 | -| * AcVoltageDivisor | 0x0601 | -| * AcCurrentMultiplier | 0x0602 | -| * AcCurrentDivisor | 0x0603 | -| * AcPowerMultiplier | 0x0604 | -| * AcPowerDivisor | 0x0605 | -| * OverloadAlarmsMask | 0x0700 | -| * VoltageOverload | 0x0701 | -| * CurrentOverload | 0x0702 | -| * AcOverloadAlarmsMask | 0x0800 | -| * AcVoltageOverload | 0x0801 | -| * AcCurrentOverload | 0x0802 | -| * AcActivePowerOverload | 0x0803 | -| * AcReactivePowerOverload | 0x0804 | -| * AverageRmsOverVoltage | 0x0805 | -| * AverageRmsUnderVoltage | 0x0806 | -| * RmsExtremeOverVoltage | 0x0807 | -| * RmsExtremeUnderVoltage | 0x0808 | -| * RmsVoltageSag | 0x0809 | -| * RmsVoltageSwell | 0x080A | -| * LineCurrentPhaseB | 0x0901 | -| * ActiveCurrentPhaseB | 0x0902 | -| * ReactiveCurrentPhaseB | 0x0903 | -| * RmsVoltagePhaseB | 0x0905 | -| * RmsVoltageMinPhaseB | 0x0906 | -| * RmsVoltageMaxPhaseB | 0x0907 | -| * RmsCurrentPhaseB | 0x0908 | -| * RmsCurrentMinPhaseB | 0x0909 | -| * RmsCurrentMaxPhaseB | 0x090A | -| * ActivePowerPhaseB | 0x090B | -| * ActivePowerMinPhaseB | 0x090C | -| * ActivePowerMaxPhaseB | 0x090D | -| * ReactivePowerPhaseB | 0x090E | -| * ApparentPowerPhaseB | 0x090F | -| * PowerFactorPhaseB | 0x0910 | -| * AverageRmsVoltageMeasurementPeriodPhaseB | 0x0911 | -| * AverageRmsOverVoltageCounterPhaseB | 0x0912 | -| * AverageRmsUnderVoltageCounterPhaseB | 0x0913 | -| * RmsExtremeOverVoltagePeriodPhaseB | 0x0914 | -| * RmsExtremeUnderVoltagePeriodPhaseB | 0x0915 | -| * RmsVoltageSagPeriodPhaseB | 0x0916 | -| * RmsVoltageSwellPeriodPhaseB | 0x0917 | -| * LineCurrentPhaseC | 0x0A01 | -| * ActiveCurrentPhaseC | 0x0A02 | -| * ReactiveCurrentPhaseC | 0x0A03 | -| * RmsVoltagePhaseC | 0x0A05 | -| * RmsVoltageMinPhaseC | 0x0A06 | -| * RmsVoltageMaxPhaseC | 0x0A07 | -| * RmsCurrentPhaseC | 0x0A08 | -| * RmsCurrentMinPhaseC | 0x0A09 | -| * RmsCurrentMaxPhaseC | 0x0A0A | -| * ActivePowerPhaseC | 0x0A0B | -| * ActivePowerMinPhaseC | 0x0A0C | -| * ActivePowerMaxPhaseC | 0x0A0D | -| * ReactivePowerPhaseC | 0x0A0E | -| * ApparentPowerPhaseC | 0x0A0F | -| * PowerFactorPhaseC | 0x0A10 | -| * AverageRmsVoltageMeasurementPeriodPhaseC | 0x0A11 | -| * AverageRmsOverVoltageCounterPhaseC | 0x0A12 | -| * AverageRmsUnderVoltageCounterPhaseC | 0x0A13 | -| * RmsExtremeOverVoltagePeriodPhaseC | 0x0A14 | -| * RmsExtremeUnderVoltagePeriodPhaseC | 0x0A15 | -| * RmsVoltageSagPeriodPhaseC | 0x0A16 | -| * RmsVoltageSwellPeriodPhaseC | 0x0A17 | -| * GeneratedCommandList | 0xFFF8 | -| * AcceptedCommandList | 0xFFF9 | -| * EventList | 0xFFFA | -| * AttributeList | 0xFFFB | -| * FeatureMap | 0xFFFC | -| * ClusterRevision | 0xFFFD | -|------------------------------------------------------------------------------| -| Events: | | -\*----------------------------------------------------------------------------*/ - -/* - * Command GetProfileInfoCommand - */ -class ElectricalMeasurementGetProfileInfoCommand : public ClusterCommand -{ -public: - ElectricalMeasurementGetProfileInfoCommand(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("get-profile-info-command", credsIssuerConfig) - { - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::ElectricalMeasurement::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoCommand::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, - commandId, endpointIds.at(0)); - return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::ElectricalMeasurement::Id; - constexpr chip::CommandId commandId = chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoCommand::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, - groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); - } - -private: - chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoCommand::Type mRequest; -}; - -/* - * Command GetMeasurementProfileCommand - */ -class ElectricalMeasurementGetMeasurementProfileCommand : public ClusterCommand -{ -public: - ElectricalMeasurementGetMeasurementProfileCommand(CredentialIssuerCommands * credsIssuerConfig) : - ClusterCommand("get-measurement-profile-command", credsIssuerConfig) - { - AddArgument("AttributeId", 0, UINT16_MAX, &mRequest.attributeId); - AddArgument("StartTime", 0, UINT32_MAX, &mRequest.startTime); - AddArgument("NumberOfIntervals", 0, UINT8_MAX, &mRequest.numberOfIntervals); - ClusterCommand::AddArguments(); - } - - CHIP_ERROR SendCommand(chip::DeviceProxy * device, std::vector endpointIds) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::ElectricalMeasurement::Id; - constexpr chip::CommandId commandId = - chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileCommand::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on endpoint %u", clusterId, - commandId, endpointIds.at(0)); - return ClusterCommand::SendCommand(device, endpointIds.at(0), clusterId, commandId, mRequest); - } - - CHIP_ERROR SendGroupCommand(chip::GroupId groupId, chip::FabricIndex fabricIndex) override - { - constexpr chip::ClusterId clusterId = chip::app::Clusters::ElectricalMeasurement::Id; - constexpr chip::CommandId commandId = - chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileCommand::Id; - - ChipLogProgress(chipTool, "Sending cluster (0x%08" PRIX32 ") command (0x%08" PRIX32 ") on Group %u", clusterId, commandId, - groupId); - - return ClusterCommand::SendGroupCommand(groupId, fabricIndex, clusterId, commandId, mRequest); - } - -private: - chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileCommand::Type mRequest; -}; - /*----------------------------------------------------------------------------*\ | Cluster UnitTesting | 0xFFF1FC05 | |------------------------------------------------------------------------------| @@ -15748,65 +15373,6 @@ void registerClusterOnOff(Commands & commands, CredentialIssuerCommands * credsI commands.RegisterCluster(clusterName, clusterCommands); } -void registerClusterOnOffSwitchConfiguration(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) -{ - using namespace chip::app::Clusters::OnOffSwitchConfiguration; - - const char * clusterName = "OnOffSwitchConfiguration"; - - commands_list clusterCommands = { - // - // Commands - // - make_unique(Id, credsIssuerConfig), // - // - // Attributes - // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "switch-type", Attributes::SwitchType::Id, credsIssuerConfig), // - make_unique(Id, "switch-actions", Attributes::SwitchActions::Id, credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "switch-type", 0, UINT8_MAX, Attributes::SwitchType::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "switch-actions", 0, UINT8_MAX, Attributes::SwitchActions::Id, - WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>>( - Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>>( - Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "switch-type", Attributes::SwitchType::Id, credsIssuerConfig), // - make_unique(Id, "switch-actions", Attributes::SwitchActions::Id, credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - // - // Events - // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - }; - - commands.RegisterCluster(clusterName, clusterCommands); -} void registerClusterLevelControl(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::LevelControl; @@ -15926,11 +15492,11 @@ void registerClusterLevelControl(Commands & commands, CredentialIssuerCommands * commands.RegisterCluster(clusterName, clusterCommands); } -void registerClusterBinaryInputBasic(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +void registerClusterPulseWidthModulation(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { - using namespace chip::app::Clusters::BinaryInputBasic; + using namespace chip::app::Clusters::PulseWidthModulation; - const char * clusterName = "BinaryInputBasic"; + const char * clusterName = "PulseWidthModulation"; commands_list clusterCommands = { // @@ -15941,15 +15507,6 @@ void registerClusterBinaryInputBasic(Commands & commands, CredentialIssuerComman // Attributes // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "active-text", Attributes::ActiveText::Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // - make_unique(Id, "inactive-text", Attributes::InactiveText::Id, credsIssuerConfig), // - make_unique(Id, "out-of-service", Attributes::OutOfService::Id, credsIssuerConfig), // - make_unique(Id, "polarity", Attributes::Polarity::Id, credsIssuerConfig), // - make_unique(Id, "present-value", Attributes::PresentValue::Id, credsIssuerConfig), // - make_unique(Id, "reliability", Attributes::Reliability::Id, credsIssuerConfig), // - make_unique(Id, "status-flags", Attributes::StatusFlags::Id, credsIssuerConfig), // - make_unique(Id, "application-type", Attributes::ApplicationType::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // @@ -15957,24 +15514,6 @@ void registerClusterBinaryInputBasic(Commands & commands, CredentialIssuerComman make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "active-text", Attributes::ActiveText::Id, WriteCommandType::kWrite, - credsIssuerConfig), // - make_unique>(Id, "description", Attributes::Description::Id, WriteCommandType::kWrite, - credsIssuerConfig), // - make_unique>(Id, "inactive-text", Attributes::InactiveText::Id, WriteCommandType::kWrite, - credsIssuerConfig), // - make_unique>(Id, "out-of-service", 0, 1, Attributes::OutOfService::Id, WriteCommandType::kWrite, - credsIssuerConfig), // - make_unique>(Id, "polarity", 0, UINT8_MAX, Attributes::Polarity::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "present-value", 0, 1, Attributes::PresentValue::Id, WriteCommandType::kWrite, - credsIssuerConfig), // - make_unique>(Id, "reliability", 0, UINT8_MAX, Attributes::Reliability::Id, WriteCommandType::kWrite, - credsIssuerConfig), // - make_unique>(Id, "status-flags", 0, UINT8_MAX, Attributes::StatusFlags::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "application-type", 0, UINT32_MAX, Attributes::ApplicationType::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique>>( Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // @@ -15989,15 +15528,6 @@ void registerClusterBinaryInputBasic(Commands & commands, CredentialIssuerComman make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "active-text", Attributes::ActiveText::Id, credsIssuerConfig), // - make_unique(Id, "description", Attributes::Description::Id, credsIssuerConfig), // - make_unique(Id, "inactive-text", Attributes::InactiveText::Id, credsIssuerConfig), // - make_unique(Id, "out-of-service", Attributes::OutOfService::Id, credsIssuerConfig), // - make_unique(Id, "polarity", Attributes::Polarity::Id, credsIssuerConfig), // - make_unique(Id, "present-value", Attributes::PresentValue::Id, credsIssuerConfig), // - make_unique(Id, "reliability", Attributes::Reliability::Id, credsIssuerConfig), // - make_unique(Id, "status-flags", Attributes::StatusFlags::Id, credsIssuerConfig), // - make_unique(Id, "application-type", Attributes::ApplicationType::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // @@ -16013,11 +15543,11 @@ void registerClusterBinaryInputBasic(Commands & commands, CredentialIssuerComman commands.RegisterCluster(clusterName, clusterCommands); } -void registerClusterPulseWidthModulation(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) +void registerClusterDescriptor(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { - using namespace chip::app::Clusters::PulseWidthModulation; + using namespace chip::app::Clusters::Descriptor; - const char * clusterName = "PulseWidthModulation"; + const char * clusterName = "Descriptor"; commands_list clusterCommands = { // @@ -16028,62 +15558,11 @@ void registerClusterPulseWidthModulation(Commands & commands, CredentialIssuerCo // Attributes // make_unique(Id, credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - make_unique>(Id, credsIssuerConfig), // - make_unique>>( - Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>>( - Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - // - // Events - // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - }; - - commands.RegisterCluster(clusterName, clusterCommands); -} -void registerClusterDescriptor(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) -{ - using namespace chip::app::Clusters::Descriptor; - - const char * clusterName = "Descriptor"; - - commands_list clusterCommands = { - // - // Commands - // - make_unique(Id, credsIssuerConfig), // - // - // Attributes - // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "device-type-list", Attributes::DeviceTypeList::Id, credsIssuerConfig), // - make_unique(Id, "server-list", Attributes::ServerList::Id, credsIssuerConfig), // - make_unique(Id, "client-list", Attributes::ClientList::Id, credsIssuerConfig), // - make_unique(Id, "parts-list", Attributes::PartsList::Id, credsIssuerConfig), // - make_unique(Id, "tag-list", Attributes::TagList::Id, credsIssuerConfig), // + make_unique(Id, "device-type-list", Attributes::DeviceTypeList::Id, credsIssuerConfig), // + make_unique(Id, "server-list", Attributes::ServerList::Id, credsIssuerConfig), // + make_unique(Id, "client-list", Attributes::ClientList::Id, credsIssuerConfig), // + make_unique(Id, "parts-list", Attributes::PartsList::Id, credsIssuerConfig), // + make_unique(Id, "tag-list", Attributes::TagList::Id, credsIssuerConfig), // make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // @@ -22663,105 +22142,6 @@ void registerClusterWindowCovering(Commands & commands, CredentialIssuerCommands commands.RegisterCluster(clusterName, clusterCommands); } -void registerClusterBarrierControl(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) -{ - using namespace chip::app::Clusters::BarrierControl; - - const char * clusterName = "BarrierControl"; - - commands_list clusterCommands = { - // - // Commands - // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - // - // Attributes - // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "barrier-moving-state", Attributes::BarrierMovingState::Id, credsIssuerConfig), // - make_unique(Id, "barrier-safety-status", Attributes::BarrierSafetyStatus::Id, credsIssuerConfig), // - make_unique(Id, "barrier-capabilities", Attributes::BarrierCapabilities::Id, credsIssuerConfig), // - make_unique(Id, "barrier-open-events", Attributes::BarrierOpenEvents::Id, credsIssuerConfig), // - make_unique(Id, "barrier-close-events", Attributes::BarrierCloseEvents::Id, credsIssuerConfig), // - make_unique(Id, "barrier-command-open-events", Attributes::BarrierCommandOpenEvents::Id, - credsIssuerConfig), // - make_unique(Id, "barrier-command-close-events", Attributes::BarrierCommandCloseEvents::Id, - credsIssuerConfig), // - make_unique(Id, "barrier-open-period", Attributes::BarrierOpenPeriod::Id, credsIssuerConfig), // - make_unique(Id, "barrier-close-period", Attributes::BarrierClosePeriod::Id, credsIssuerConfig), // - make_unique(Id, "barrier-position", Attributes::BarrierPosition::Id, credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "barrier-moving-state", 0, UINT8_MAX, Attributes::BarrierMovingState::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "barrier-safety-status", 0, UINT16_MAX, Attributes::BarrierSafetyStatus::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "barrier-capabilities", 0, UINT8_MAX, Attributes::BarrierCapabilities::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "barrier-open-events", 0, UINT16_MAX, Attributes::BarrierOpenEvents::Id, - WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>(Id, "barrier-close-events", 0, UINT16_MAX, Attributes::BarrierCloseEvents::Id, - WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>(Id, "barrier-command-open-events", 0, UINT16_MAX, - Attributes::BarrierCommandOpenEvents::Id, WriteCommandType::kWrite, - credsIssuerConfig), // - make_unique>(Id, "barrier-command-close-events", 0, UINT16_MAX, - Attributes::BarrierCommandCloseEvents::Id, WriteCommandType::kWrite, - credsIssuerConfig), // - make_unique>(Id, "barrier-open-period", 0, UINT16_MAX, Attributes::BarrierOpenPeriod::Id, - WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>(Id, "barrier-close-period", 0, UINT16_MAX, Attributes::BarrierClosePeriod::Id, - WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>(Id, "barrier-position", 0, UINT8_MAX, Attributes::BarrierPosition::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>>( - Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "barrier-moving-state", Attributes::BarrierMovingState::Id, credsIssuerConfig), // - make_unique(Id, "barrier-safety-status", Attributes::BarrierSafetyStatus::Id, credsIssuerConfig), // - make_unique(Id, "barrier-capabilities", Attributes::BarrierCapabilities::Id, credsIssuerConfig), // - make_unique(Id, "barrier-open-events", Attributes::BarrierOpenEvents::Id, credsIssuerConfig), // - make_unique(Id, "barrier-close-events", Attributes::BarrierCloseEvents::Id, credsIssuerConfig), // - make_unique(Id, "barrier-command-open-events", Attributes::BarrierCommandOpenEvents::Id, - credsIssuerConfig), // - make_unique(Id, "barrier-command-close-events", Attributes::BarrierCommandCloseEvents::Id, - credsIssuerConfig), // - make_unique(Id, "barrier-open-period", Attributes::BarrierOpenPeriod::Id, credsIssuerConfig), // - make_unique(Id, "barrier-close-period", Attributes::BarrierClosePeriod::Id, credsIssuerConfig), // - make_unique(Id, "barrier-position", Attributes::BarrierPosition::Id, credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - // - // Events - // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - }; - - commands.RegisterCluster(clusterName, clusterCommands); -} void registerClusterServiceArea(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::ServiceArea; @@ -26910,702 +26290,6 @@ void registerClusterCommissionerControl(Commands & commands, CredentialIssuerCom commands.RegisterCluster(clusterName, clusterCommands); } -void registerClusterElectricalMeasurement(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) -{ - using namespace chip::app::Clusters::ElectricalMeasurement; - - const char * clusterName = "ElectricalMeasurement"; - - commands_list clusterCommands = { - // - // Commands - // - make_unique(Id, credsIssuerConfig), // - make_unique(credsIssuerConfig), // - make_unique(credsIssuerConfig), // - // - // Attributes - // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "measurement-type", Attributes::MeasurementType::Id, credsIssuerConfig), // - make_unique(Id, "dc-voltage", Attributes::DcVoltage::Id, credsIssuerConfig), // - make_unique(Id, "dc-voltage-min", Attributes::DcVoltageMin::Id, credsIssuerConfig), // - make_unique(Id, "dc-voltage-max", Attributes::DcVoltageMax::Id, credsIssuerConfig), // - make_unique(Id, "dc-current", Attributes::DcCurrent::Id, credsIssuerConfig), // - make_unique(Id, "dc-current-min", Attributes::DcCurrentMin::Id, credsIssuerConfig), // - make_unique(Id, "dc-current-max", Attributes::DcCurrentMax::Id, credsIssuerConfig), // - make_unique(Id, "dc-power", Attributes::DcPower::Id, credsIssuerConfig), // - make_unique(Id, "dc-power-min", Attributes::DcPowerMin::Id, credsIssuerConfig), // - make_unique(Id, "dc-power-max", Attributes::DcPowerMax::Id, credsIssuerConfig), // - make_unique(Id, "dc-voltage-multiplier", Attributes::DcVoltageMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "dc-voltage-divisor", Attributes::DcVoltageDivisor::Id, credsIssuerConfig), // - make_unique(Id, "dc-current-multiplier", Attributes::DcCurrentMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "dc-current-divisor", Attributes::DcCurrentDivisor::Id, credsIssuerConfig), // - make_unique(Id, "dc-power-multiplier", Attributes::DcPowerMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "dc-power-divisor", Attributes::DcPowerDivisor::Id, credsIssuerConfig), // - make_unique(Id, "ac-frequency", Attributes::AcFrequency::Id, credsIssuerConfig), // - make_unique(Id, "ac-frequency-min", Attributes::AcFrequencyMin::Id, credsIssuerConfig), // - make_unique(Id, "ac-frequency-max", Attributes::AcFrequencyMax::Id, credsIssuerConfig), // - make_unique(Id, "neutral-current", Attributes::NeutralCurrent::Id, credsIssuerConfig), // - make_unique(Id, "total-active-power", Attributes::TotalActivePower::Id, credsIssuerConfig), // - make_unique(Id, "total-reactive-power", Attributes::TotalReactivePower::Id, credsIssuerConfig), // - make_unique(Id, "total-apparent-power", Attributes::TotalApparentPower::Id, credsIssuerConfig), // - make_unique(Id, "measured1st-harmonic-current", Attributes::Measured1stHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured3rd-harmonic-current", Attributes::Measured3rdHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured5th-harmonic-current", Attributes::Measured5thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured7th-harmonic-current", Attributes::Measured7thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured9th-harmonic-current", Attributes::Measured9thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured11th-harmonic-current", Attributes::Measured11thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured-phase1st-harmonic-current", Attributes::MeasuredPhase1stHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured-phase3rd-harmonic-current", Attributes::MeasuredPhase3rdHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured-phase5th-harmonic-current", Attributes::MeasuredPhase5thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured-phase7th-harmonic-current", Attributes::MeasuredPhase7thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured-phase9th-harmonic-current", Attributes::MeasuredPhase9thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured-phase11th-harmonic-current", Attributes::MeasuredPhase11thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "ac-frequency-multiplier", Attributes::AcFrequencyMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "ac-frequency-divisor", Attributes::AcFrequencyDivisor::Id, credsIssuerConfig), // - make_unique(Id, "power-multiplier", Attributes::PowerMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "power-divisor", Attributes::PowerDivisor::Id, credsIssuerConfig), // - make_unique(Id, "harmonic-current-multiplier", Attributes::HarmonicCurrentMultiplier::Id, - credsIssuerConfig), // - make_unique(Id, "phase-harmonic-current-multiplier", Attributes::PhaseHarmonicCurrentMultiplier::Id, - credsIssuerConfig), // - make_unique(Id, "instantaneous-voltage", Attributes::InstantaneousVoltage::Id, credsIssuerConfig), // - make_unique(Id, "instantaneous-line-current", Attributes::InstantaneousLineCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "instantaneous-active-current", Attributes::InstantaneousActiveCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "instantaneous-reactive-current", Attributes::InstantaneousReactiveCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "instantaneous-power", Attributes::InstantaneousPower::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage", Attributes::RmsVoltage::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-min", Attributes::RmsVoltageMin::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-max", Attributes::RmsVoltageMax::Id, credsIssuerConfig), // - make_unique(Id, "rms-current", Attributes::RmsCurrent::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-min", Attributes::RmsCurrentMin::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-max", Attributes::RmsCurrentMax::Id, credsIssuerConfig), // - make_unique(Id, "active-power", Attributes::ActivePower::Id, credsIssuerConfig), // - make_unique(Id, "active-power-min", Attributes::ActivePowerMin::Id, credsIssuerConfig), // - make_unique(Id, "active-power-max", Attributes::ActivePowerMax::Id, credsIssuerConfig), // - make_unique(Id, "reactive-power", Attributes::ReactivePower::Id, credsIssuerConfig), // - make_unique(Id, "apparent-power", Attributes::ApparentPower::Id, credsIssuerConfig), // - make_unique(Id, "power-factor", Attributes::PowerFactor::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-voltage-measurement-period", Attributes::AverageRmsVoltageMeasurementPeriod::Id, - credsIssuerConfig), // - make_unique(Id, "average-rms-under-voltage-counter", Attributes::AverageRmsUnderVoltageCounter::Id, - credsIssuerConfig), // - make_unique(Id, "rms-extreme-over-voltage-period", Attributes::RmsExtremeOverVoltagePeriod::Id, - credsIssuerConfig), // - make_unique(Id, "rms-extreme-under-voltage-period", Attributes::RmsExtremeUnderVoltagePeriod::Id, - credsIssuerConfig), // - make_unique(Id, "rms-voltage-sag-period", Attributes::RmsVoltageSagPeriod::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-swell-period", Attributes::RmsVoltageSwellPeriod::Id, credsIssuerConfig), // - make_unique(Id, "ac-voltage-multiplier", Attributes::AcVoltageMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "ac-voltage-divisor", Attributes::AcVoltageDivisor::Id, credsIssuerConfig), // - make_unique(Id, "ac-current-multiplier", Attributes::AcCurrentMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "ac-current-divisor", Attributes::AcCurrentDivisor::Id, credsIssuerConfig), // - make_unique(Id, "ac-power-multiplier", Attributes::AcPowerMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "ac-power-divisor", Attributes::AcPowerDivisor::Id, credsIssuerConfig), // - make_unique(Id, "overload-alarms-mask", Attributes::OverloadAlarmsMask::Id, credsIssuerConfig), // - make_unique(Id, "voltage-overload", Attributes::VoltageOverload::Id, credsIssuerConfig), // - make_unique(Id, "current-overload", Attributes::CurrentOverload::Id, credsIssuerConfig), // - make_unique(Id, "ac-overload-alarms-mask", Attributes::AcOverloadAlarmsMask::Id, credsIssuerConfig), // - make_unique(Id, "ac-voltage-overload", Attributes::AcVoltageOverload::Id, credsIssuerConfig), // - make_unique(Id, "ac-current-overload", Attributes::AcCurrentOverload::Id, credsIssuerConfig), // - make_unique(Id, "ac-active-power-overload", Attributes::AcActivePowerOverload::Id, credsIssuerConfig), // - make_unique(Id, "ac-reactive-power-overload", Attributes::AcReactivePowerOverload::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-over-voltage", Attributes::AverageRmsOverVoltage::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-under-voltage", Attributes::AverageRmsUnderVoltage::Id, credsIssuerConfig), // - make_unique(Id, "rms-extreme-over-voltage", Attributes::RmsExtremeOverVoltage::Id, credsIssuerConfig), // - make_unique(Id, "rms-extreme-under-voltage", Attributes::RmsExtremeUnderVoltage::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-sag", Attributes::RmsVoltageSag::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-swell", Attributes::RmsVoltageSwell::Id, credsIssuerConfig), // - make_unique(Id, "line-current-phase-b", Attributes::LineCurrentPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "active-current-phase-b", Attributes::ActiveCurrentPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "reactive-current-phase-b", Attributes::ReactiveCurrentPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-phase-b", Attributes::RmsVoltagePhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-min-phase-b", Attributes::RmsVoltageMinPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-max-phase-b", Attributes::RmsVoltageMaxPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-phase-b", Attributes::RmsCurrentPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-min-phase-b", Attributes::RmsCurrentMinPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-max-phase-b", Attributes::RmsCurrentMaxPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "active-power-phase-b", Attributes::ActivePowerPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "active-power-min-phase-b", Attributes::ActivePowerMinPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "active-power-max-phase-b", Attributes::ActivePowerMaxPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "reactive-power-phase-b", Attributes::ReactivePowerPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "apparent-power-phase-b", Attributes::ApparentPowerPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "power-factor-phase-b", Attributes::PowerFactorPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-voltage-measurement-period-phase-b", - Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-over-voltage-counter-phase-b", - Attributes::AverageRmsOverVoltageCounterPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-under-voltage-counter-phase-b", - Attributes::AverageRmsUnderVoltageCounterPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-extreme-over-voltage-period-phase-b", Attributes::RmsExtremeOverVoltagePeriodPhaseB::Id, - credsIssuerConfig), // - make_unique(Id, "rms-extreme-under-voltage-period-phase-b", - Attributes::RmsExtremeUnderVoltagePeriodPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-sag-period-phase-b", Attributes::RmsVoltageSagPeriodPhaseB::Id, - credsIssuerConfig), // - make_unique(Id, "rms-voltage-swell-period-phase-b", Attributes::RmsVoltageSwellPeriodPhaseB::Id, - credsIssuerConfig), // - make_unique(Id, "line-current-phase-c", Attributes::LineCurrentPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "active-current-phase-c", Attributes::ActiveCurrentPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "reactive-current-phase-c", Attributes::ReactiveCurrentPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-phase-c", Attributes::RmsVoltagePhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-min-phase-c", Attributes::RmsVoltageMinPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-max-phase-c", Attributes::RmsVoltageMaxPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-phase-c", Attributes::RmsCurrentPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-min-phase-c", Attributes::RmsCurrentMinPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-max-phase-c", Attributes::RmsCurrentMaxPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "active-power-phase-c", Attributes::ActivePowerPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "active-power-min-phase-c", Attributes::ActivePowerMinPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "active-power-max-phase-c", Attributes::ActivePowerMaxPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "reactive-power-phase-c", Attributes::ReactivePowerPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "apparent-power-phase-c", Attributes::ApparentPowerPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "power-factor-phase-c", Attributes::PowerFactorPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-voltage-measurement-period-phase-c", - Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-over-voltage-counter-phase-c", - Attributes::AverageRmsOverVoltageCounterPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-under-voltage-counter-phase-c", - Attributes::AverageRmsUnderVoltageCounterPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-extreme-over-voltage-period-phase-c", Attributes::RmsExtremeOverVoltagePeriodPhaseC::Id, - credsIssuerConfig), // - make_unique(Id, "rms-extreme-under-voltage-period-phase-c", - Attributes::RmsExtremeUnderVoltagePeriodPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-sag-period-phase-c", Attributes::RmsVoltageSagPeriodPhaseC::Id, - credsIssuerConfig), // - make_unique(Id, "rms-voltage-swell-period-phase-c", Attributes::RmsVoltageSwellPeriodPhaseC::Id, - credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - make_unique>(Id, credsIssuerConfig), // - make_unique>(Id, "measurement-type", 0, UINT32_MAX, Attributes::MeasurementType::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "dc-voltage", INT16_MIN, INT16_MAX, Attributes::DcVoltage::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "dc-voltage-min", INT16_MIN, INT16_MAX, Attributes::DcVoltageMin::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "dc-voltage-max", INT16_MIN, INT16_MAX, Attributes::DcVoltageMax::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "dc-current", INT16_MIN, INT16_MAX, Attributes::DcCurrent::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "dc-current-min", INT16_MIN, INT16_MAX, Attributes::DcCurrentMin::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "dc-current-max", INT16_MIN, INT16_MAX, Attributes::DcCurrentMax::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "dc-power", INT16_MIN, INT16_MAX, Attributes::DcPower::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "dc-power-min", INT16_MIN, INT16_MAX, Attributes::DcPowerMin::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "dc-power-max", INT16_MIN, INT16_MAX, Attributes::DcPowerMax::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "dc-voltage-multiplier", 0, UINT16_MAX, Attributes::DcVoltageMultiplier::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "dc-voltage-divisor", 0, UINT16_MAX, Attributes::DcVoltageDivisor::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "dc-current-multiplier", 0, UINT16_MAX, Attributes::DcCurrentMultiplier::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "dc-current-divisor", 0, UINT16_MAX, Attributes::DcCurrentDivisor::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "dc-power-multiplier", 0, UINT16_MAX, Attributes::DcPowerMultiplier::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "dc-power-divisor", 0, UINT16_MAX, Attributes::DcPowerDivisor::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "ac-frequency", 0, UINT16_MAX, Attributes::AcFrequency::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "ac-frequency-min", 0, UINT16_MAX, Attributes::AcFrequencyMin::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "ac-frequency-max", 0, UINT16_MAX, Attributes::AcFrequencyMax::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "neutral-current", 0, UINT16_MAX, Attributes::NeutralCurrent::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "total-active-power", INT32_MIN, INT32_MAX, Attributes::TotalActivePower::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "total-reactive-power", INT32_MIN, INT32_MAX, Attributes::TotalReactivePower::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "total-apparent-power", 0, UINT32_MAX, Attributes::TotalApparentPower::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "measured1st-harmonic-current", INT16_MIN, INT16_MAX, - Attributes::Measured1stHarmonicCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "measured3rd-harmonic-current", INT16_MIN, INT16_MAX, - Attributes::Measured3rdHarmonicCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "measured5th-harmonic-current", INT16_MIN, INT16_MAX, - Attributes::Measured5thHarmonicCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "measured7th-harmonic-current", INT16_MIN, INT16_MAX, - Attributes::Measured7thHarmonicCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "measured9th-harmonic-current", INT16_MIN, INT16_MAX, - Attributes::Measured9thHarmonicCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "measured11th-harmonic-current", INT16_MIN, INT16_MAX, - Attributes::Measured11thHarmonicCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "measured-phase1st-harmonic-current", INT16_MIN, INT16_MAX, - Attributes::MeasuredPhase1stHarmonicCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "measured-phase3rd-harmonic-current", INT16_MIN, INT16_MAX, - Attributes::MeasuredPhase3rdHarmonicCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "measured-phase5th-harmonic-current", INT16_MIN, INT16_MAX, - Attributes::MeasuredPhase5thHarmonicCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "measured-phase7th-harmonic-current", INT16_MIN, INT16_MAX, - Attributes::MeasuredPhase7thHarmonicCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "measured-phase9th-harmonic-current", INT16_MIN, INT16_MAX, - Attributes::MeasuredPhase9thHarmonicCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "measured-phase11th-harmonic-current", INT16_MIN, INT16_MAX, - Attributes::MeasuredPhase11thHarmonicCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "ac-frequency-multiplier", 0, UINT16_MAX, Attributes::AcFrequencyMultiplier::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "ac-frequency-divisor", 0, UINT16_MAX, Attributes::AcFrequencyDivisor::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "power-multiplier", 0, UINT32_MAX, Attributes::PowerMultiplier::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "power-divisor", 0, UINT32_MAX, Attributes::PowerDivisor::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "harmonic-current-multiplier", INT8_MIN, INT8_MAX, - Attributes::HarmonicCurrentMultiplier::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "phase-harmonic-current-multiplier", INT8_MIN, INT8_MAX, - Attributes::PhaseHarmonicCurrentMultiplier::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "instantaneous-voltage", INT16_MIN, INT16_MAX, - Attributes::InstantaneousVoltage::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "instantaneous-line-current", 0, UINT16_MAX, - Attributes::InstantaneousLineCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "instantaneous-active-current", INT16_MIN, INT16_MAX, - Attributes::InstantaneousActiveCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "instantaneous-reactive-current", INT16_MIN, INT16_MAX, - Attributes::InstantaneousReactiveCurrent::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "instantaneous-power", INT16_MIN, INT16_MAX, Attributes::InstantaneousPower::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-voltage", 0, UINT16_MAX, Attributes::RmsVoltage::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-voltage-min", 0, UINT16_MAX, Attributes::RmsVoltageMin::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-voltage-max", 0, UINT16_MAX, Attributes::RmsVoltageMax::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-current", 0, UINT16_MAX, Attributes::RmsCurrent::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-current-min", 0, UINT16_MAX, Attributes::RmsCurrentMin::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-current-max", 0, UINT16_MAX, Attributes::RmsCurrentMax::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "active-power", INT16_MIN, INT16_MAX, Attributes::ActivePower::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "active-power-min", INT16_MIN, INT16_MAX, Attributes::ActivePowerMin::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "active-power-max", INT16_MIN, INT16_MAX, Attributes::ActivePowerMax::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "reactive-power", INT16_MIN, INT16_MAX, Attributes::ReactivePower::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "apparent-power", 0, UINT16_MAX, Attributes::ApparentPower::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "power-factor", INT8_MIN, INT8_MAX, Attributes::PowerFactor::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "average-rms-voltage-measurement-period", 0, UINT16_MAX, - Attributes::AverageRmsVoltageMeasurementPeriod::Id, WriteCommandType::kWrite, - credsIssuerConfig), // - make_unique>(Id, "average-rms-under-voltage-counter", 0, UINT16_MAX, - Attributes::AverageRmsUnderVoltageCounter::Id, WriteCommandType::kWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-extreme-over-voltage-period", 0, UINT16_MAX, - Attributes::RmsExtremeOverVoltagePeriod::Id, WriteCommandType::kWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-extreme-under-voltage-period", 0, UINT16_MAX, - Attributes::RmsExtremeUnderVoltagePeriod::Id, WriteCommandType::kWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-voltage-sag-period", 0, UINT16_MAX, Attributes::RmsVoltageSagPeriod::Id, - WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>(Id, "rms-voltage-swell-period", 0, UINT16_MAX, Attributes::RmsVoltageSwellPeriod::Id, - WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>(Id, "ac-voltage-multiplier", 0, UINT16_MAX, Attributes::AcVoltageMultiplier::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "ac-voltage-divisor", 0, UINT16_MAX, Attributes::AcVoltageDivisor::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "ac-current-multiplier", 0, UINT16_MAX, Attributes::AcCurrentMultiplier::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "ac-current-divisor", 0, UINT16_MAX, Attributes::AcCurrentDivisor::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "ac-power-multiplier", 0, UINT16_MAX, Attributes::AcPowerMultiplier::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "ac-power-divisor", 0, UINT16_MAX, Attributes::AcPowerDivisor::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "overload-alarms-mask", 0, UINT8_MAX, Attributes::OverloadAlarmsMask::Id, - WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>(Id, "voltage-overload", INT16_MIN, INT16_MAX, Attributes::VoltageOverload::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "current-overload", INT16_MIN, INT16_MAX, Attributes::CurrentOverload::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "ac-overload-alarms-mask", 0, UINT16_MAX, Attributes::AcOverloadAlarmsMask::Id, - WriteCommandType::kWrite, credsIssuerConfig), // - make_unique>(Id, "ac-voltage-overload", INT16_MIN, INT16_MAX, Attributes::AcVoltageOverload::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "ac-current-overload", INT16_MIN, INT16_MAX, Attributes::AcCurrentOverload::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "ac-active-power-overload", INT16_MIN, INT16_MAX, - Attributes::AcActivePowerOverload::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "ac-reactive-power-overload", INT16_MIN, INT16_MAX, - Attributes::AcReactivePowerOverload::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "average-rms-over-voltage", INT16_MIN, INT16_MAX, - Attributes::AverageRmsOverVoltage::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "average-rms-under-voltage", INT16_MIN, INT16_MAX, - Attributes::AverageRmsUnderVoltage::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-extreme-over-voltage", INT16_MIN, INT16_MAX, - Attributes::RmsExtremeOverVoltage::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-extreme-under-voltage", INT16_MIN, INT16_MAX, - Attributes::RmsExtremeUnderVoltage::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-voltage-sag", INT16_MIN, INT16_MAX, Attributes::RmsVoltageSag::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-voltage-swell", INT16_MIN, INT16_MAX, Attributes::RmsVoltageSwell::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "line-current-phase-b", 0, UINT16_MAX, Attributes::LineCurrentPhaseB::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "active-current-phase-b", INT16_MIN, INT16_MAX, - Attributes::ActiveCurrentPhaseB::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "reactive-current-phase-b", INT16_MIN, INT16_MAX, - Attributes::ReactiveCurrentPhaseB::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-voltage-phase-b", 0, UINT16_MAX, Attributes::RmsVoltagePhaseB::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-voltage-min-phase-b", 0, UINT16_MAX, Attributes::RmsVoltageMinPhaseB::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-voltage-max-phase-b", 0, UINT16_MAX, Attributes::RmsVoltageMaxPhaseB::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-current-phase-b", 0, UINT16_MAX, Attributes::RmsCurrentPhaseB::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-current-min-phase-b", 0, UINT16_MAX, Attributes::RmsCurrentMinPhaseB::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-current-max-phase-b", 0, UINT16_MAX, Attributes::RmsCurrentMaxPhaseB::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "active-power-phase-b", INT16_MIN, INT16_MAX, Attributes::ActivePowerPhaseB::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "active-power-min-phase-b", INT16_MIN, INT16_MAX, - Attributes::ActivePowerMinPhaseB::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "active-power-max-phase-b", INT16_MIN, INT16_MAX, - Attributes::ActivePowerMaxPhaseB::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "reactive-power-phase-b", INT16_MIN, INT16_MAX, - Attributes::ReactivePowerPhaseB::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "apparent-power-phase-b", 0, UINT16_MAX, Attributes::ApparentPowerPhaseB::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "power-factor-phase-b", INT8_MIN, INT8_MAX, Attributes::PowerFactorPhaseB::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "average-rms-voltage-measurement-period-phase-b", 0, UINT16_MAX, - Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "average-rms-over-voltage-counter-phase-b", 0, UINT16_MAX, - Attributes::AverageRmsOverVoltageCounterPhaseB::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "average-rms-under-voltage-counter-phase-b", 0, UINT16_MAX, - Attributes::AverageRmsUnderVoltageCounterPhaseB::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-extreme-over-voltage-period-phase-b", 0, UINT16_MAX, - Attributes::RmsExtremeOverVoltagePeriodPhaseB::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-extreme-under-voltage-period-phase-b", 0, UINT16_MAX, - Attributes::RmsExtremeUnderVoltagePeriodPhaseB::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-voltage-sag-period-phase-b", 0, UINT16_MAX, - Attributes::RmsVoltageSagPeriodPhaseB::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-voltage-swell-period-phase-b", 0, UINT16_MAX, - Attributes::RmsVoltageSwellPeriodPhaseB::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "line-current-phase-c", 0, UINT16_MAX, Attributes::LineCurrentPhaseC::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "active-current-phase-c", INT16_MIN, INT16_MAX, - Attributes::ActiveCurrentPhaseC::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "reactive-current-phase-c", INT16_MIN, INT16_MAX, - Attributes::ReactiveCurrentPhaseC::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-voltage-phase-c", 0, UINT16_MAX, Attributes::RmsVoltagePhaseC::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-voltage-min-phase-c", 0, UINT16_MAX, Attributes::RmsVoltageMinPhaseC::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-voltage-max-phase-c", 0, UINT16_MAX, Attributes::RmsVoltageMaxPhaseC::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-current-phase-c", 0, UINT16_MAX, Attributes::RmsCurrentPhaseC::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-current-min-phase-c", 0, UINT16_MAX, Attributes::RmsCurrentMinPhaseC::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "rms-current-max-phase-c", 0, UINT16_MAX, Attributes::RmsCurrentMaxPhaseC::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "active-power-phase-c", INT16_MIN, INT16_MAX, Attributes::ActivePowerPhaseC::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "active-power-min-phase-c", INT16_MIN, INT16_MAX, - Attributes::ActivePowerMinPhaseC::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "active-power-max-phase-c", INT16_MIN, INT16_MAX, - Attributes::ActivePowerMaxPhaseC::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "reactive-power-phase-c", INT16_MIN, INT16_MAX, - Attributes::ReactivePowerPhaseC::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "apparent-power-phase-c", 0, UINT16_MAX, Attributes::ApparentPowerPhaseC::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "power-factor-phase-c", INT8_MIN, INT8_MAX, Attributes::PowerFactorPhaseC::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "average-rms-voltage-measurement-period-phase-c", 0, UINT16_MAX, - Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "average-rms-over-voltage-counter-phase-c", 0, UINT16_MAX, - Attributes::AverageRmsOverVoltageCounterPhaseC::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "average-rms-under-voltage-counter-phase-c", 0, UINT16_MAX, - Attributes::AverageRmsUnderVoltageCounterPhaseC::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-extreme-over-voltage-period-phase-c", 0, UINT16_MAX, - Attributes::RmsExtremeOverVoltagePeriodPhaseC::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-extreme-under-voltage-period-phase-c", 0, UINT16_MAX, - Attributes::RmsExtremeUnderVoltagePeriodPhaseC::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-voltage-sag-period-phase-c", 0, UINT16_MAX, - Attributes::RmsVoltageSagPeriodPhaseC::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>(Id, "rms-voltage-swell-period-phase-c", 0, UINT16_MAX, - Attributes::RmsVoltageSwellPeriodPhaseC::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>>( - Id, "generated-command-list", Attributes::GeneratedCommandList::Id, WriteCommandType::kForceWrite, - credsIssuerConfig), // - make_unique>>( - Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "event-list", Attributes::EventList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>>( - Id, "attribute-list", Attributes::AttributeList::Id, WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "feature-map", 0, UINT32_MAX, Attributes::FeatureMap::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique>(Id, "cluster-revision", 0, UINT16_MAX, Attributes::ClusterRevision::Id, - WriteCommandType::kForceWrite, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, "measurement-type", Attributes::MeasurementType::Id, credsIssuerConfig), // - make_unique(Id, "dc-voltage", Attributes::DcVoltage::Id, credsIssuerConfig), // - make_unique(Id, "dc-voltage-min", Attributes::DcVoltageMin::Id, credsIssuerConfig), // - make_unique(Id, "dc-voltage-max", Attributes::DcVoltageMax::Id, credsIssuerConfig), // - make_unique(Id, "dc-current", Attributes::DcCurrent::Id, credsIssuerConfig), // - make_unique(Id, "dc-current-min", Attributes::DcCurrentMin::Id, credsIssuerConfig), // - make_unique(Id, "dc-current-max", Attributes::DcCurrentMax::Id, credsIssuerConfig), // - make_unique(Id, "dc-power", Attributes::DcPower::Id, credsIssuerConfig), // - make_unique(Id, "dc-power-min", Attributes::DcPowerMin::Id, credsIssuerConfig), // - make_unique(Id, "dc-power-max", Attributes::DcPowerMax::Id, credsIssuerConfig), // - make_unique(Id, "dc-voltage-multiplier", Attributes::DcVoltageMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "dc-voltage-divisor", Attributes::DcVoltageDivisor::Id, credsIssuerConfig), // - make_unique(Id, "dc-current-multiplier", Attributes::DcCurrentMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "dc-current-divisor", Attributes::DcCurrentDivisor::Id, credsIssuerConfig), // - make_unique(Id, "dc-power-multiplier", Attributes::DcPowerMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "dc-power-divisor", Attributes::DcPowerDivisor::Id, credsIssuerConfig), // - make_unique(Id, "ac-frequency", Attributes::AcFrequency::Id, credsIssuerConfig), // - make_unique(Id, "ac-frequency-min", Attributes::AcFrequencyMin::Id, credsIssuerConfig), // - make_unique(Id, "ac-frequency-max", Attributes::AcFrequencyMax::Id, credsIssuerConfig), // - make_unique(Id, "neutral-current", Attributes::NeutralCurrent::Id, credsIssuerConfig), // - make_unique(Id, "total-active-power", Attributes::TotalActivePower::Id, credsIssuerConfig), // - make_unique(Id, "total-reactive-power", Attributes::TotalReactivePower::Id, credsIssuerConfig), // - make_unique(Id, "total-apparent-power", Attributes::TotalApparentPower::Id, credsIssuerConfig), // - make_unique(Id, "measured1st-harmonic-current", Attributes::Measured1stHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured3rd-harmonic-current", Attributes::Measured3rdHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured5th-harmonic-current", Attributes::Measured5thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured7th-harmonic-current", Attributes::Measured7thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured9th-harmonic-current", Attributes::Measured9thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured11th-harmonic-current", Attributes::Measured11thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured-phase1st-harmonic-current", Attributes::MeasuredPhase1stHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured-phase3rd-harmonic-current", Attributes::MeasuredPhase3rdHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured-phase5th-harmonic-current", Attributes::MeasuredPhase5thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured-phase7th-harmonic-current", Attributes::MeasuredPhase7thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured-phase9th-harmonic-current", Attributes::MeasuredPhase9thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "measured-phase11th-harmonic-current", Attributes::MeasuredPhase11thHarmonicCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "ac-frequency-multiplier", Attributes::AcFrequencyMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "ac-frequency-divisor", Attributes::AcFrequencyDivisor::Id, credsIssuerConfig), // - make_unique(Id, "power-multiplier", Attributes::PowerMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "power-divisor", Attributes::PowerDivisor::Id, credsIssuerConfig), // - make_unique(Id, "harmonic-current-multiplier", Attributes::HarmonicCurrentMultiplier::Id, - credsIssuerConfig), // - make_unique(Id, "phase-harmonic-current-multiplier", Attributes::PhaseHarmonicCurrentMultiplier::Id, - credsIssuerConfig), // - make_unique(Id, "instantaneous-voltage", Attributes::InstantaneousVoltage::Id, credsIssuerConfig), // - make_unique(Id, "instantaneous-line-current", Attributes::InstantaneousLineCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "instantaneous-active-current", Attributes::InstantaneousActiveCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "instantaneous-reactive-current", Attributes::InstantaneousReactiveCurrent::Id, - credsIssuerConfig), // - make_unique(Id, "instantaneous-power", Attributes::InstantaneousPower::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage", Attributes::RmsVoltage::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-min", Attributes::RmsVoltageMin::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-max", Attributes::RmsVoltageMax::Id, credsIssuerConfig), // - make_unique(Id, "rms-current", Attributes::RmsCurrent::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-min", Attributes::RmsCurrentMin::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-max", Attributes::RmsCurrentMax::Id, credsIssuerConfig), // - make_unique(Id, "active-power", Attributes::ActivePower::Id, credsIssuerConfig), // - make_unique(Id, "active-power-min", Attributes::ActivePowerMin::Id, credsIssuerConfig), // - make_unique(Id, "active-power-max", Attributes::ActivePowerMax::Id, credsIssuerConfig), // - make_unique(Id, "reactive-power", Attributes::ReactivePower::Id, credsIssuerConfig), // - make_unique(Id, "apparent-power", Attributes::ApparentPower::Id, credsIssuerConfig), // - make_unique(Id, "power-factor", Attributes::PowerFactor::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-voltage-measurement-period", - Attributes::AverageRmsVoltageMeasurementPeriod::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-under-voltage-counter", Attributes::AverageRmsUnderVoltageCounter::Id, - credsIssuerConfig), // - make_unique(Id, "rms-extreme-over-voltage-period", Attributes::RmsExtremeOverVoltagePeriod::Id, - credsIssuerConfig), // - make_unique(Id, "rms-extreme-under-voltage-period", Attributes::RmsExtremeUnderVoltagePeriod::Id, - credsIssuerConfig), // - make_unique(Id, "rms-voltage-sag-period", Attributes::RmsVoltageSagPeriod::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-swell-period", Attributes::RmsVoltageSwellPeriod::Id, - credsIssuerConfig), // - make_unique(Id, "ac-voltage-multiplier", Attributes::AcVoltageMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "ac-voltage-divisor", Attributes::AcVoltageDivisor::Id, credsIssuerConfig), // - make_unique(Id, "ac-current-multiplier", Attributes::AcCurrentMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "ac-current-divisor", Attributes::AcCurrentDivisor::Id, credsIssuerConfig), // - make_unique(Id, "ac-power-multiplier", Attributes::AcPowerMultiplier::Id, credsIssuerConfig), // - make_unique(Id, "ac-power-divisor", Attributes::AcPowerDivisor::Id, credsIssuerConfig), // - make_unique(Id, "overload-alarms-mask", Attributes::OverloadAlarmsMask::Id, credsIssuerConfig), // - make_unique(Id, "voltage-overload", Attributes::VoltageOverload::Id, credsIssuerConfig), // - make_unique(Id, "current-overload", Attributes::CurrentOverload::Id, credsIssuerConfig), // - make_unique(Id, "ac-overload-alarms-mask", Attributes::AcOverloadAlarmsMask::Id, credsIssuerConfig), // - make_unique(Id, "ac-voltage-overload", Attributes::AcVoltageOverload::Id, credsIssuerConfig), // - make_unique(Id, "ac-current-overload", Attributes::AcCurrentOverload::Id, credsIssuerConfig), // - make_unique(Id, "ac-active-power-overload", Attributes::AcActivePowerOverload::Id, - credsIssuerConfig), // - make_unique(Id, "ac-reactive-power-overload", Attributes::AcReactivePowerOverload::Id, - credsIssuerConfig), // - make_unique(Id, "average-rms-over-voltage", Attributes::AverageRmsOverVoltage::Id, - credsIssuerConfig), // - make_unique(Id, "average-rms-under-voltage", Attributes::AverageRmsUnderVoltage::Id, - credsIssuerConfig), // - make_unique(Id, "rms-extreme-over-voltage", Attributes::RmsExtremeOverVoltage::Id, - credsIssuerConfig), // - make_unique(Id, "rms-extreme-under-voltage", Attributes::RmsExtremeUnderVoltage::Id, - credsIssuerConfig), // - make_unique(Id, "rms-voltage-sag", Attributes::RmsVoltageSag::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-swell", Attributes::RmsVoltageSwell::Id, credsIssuerConfig), // - make_unique(Id, "line-current-phase-b", Attributes::LineCurrentPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "active-current-phase-b", Attributes::ActiveCurrentPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "reactive-current-phase-b", Attributes::ReactiveCurrentPhaseB::Id, - credsIssuerConfig), // - make_unique(Id, "rms-voltage-phase-b", Attributes::RmsVoltagePhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-min-phase-b", Attributes::RmsVoltageMinPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-max-phase-b", Attributes::RmsVoltageMaxPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-phase-b", Attributes::RmsCurrentPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-min-phase-b", Attributes::RmsCurrentMinPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-max-phase-b", Attributes::RmsCurrentMaxPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "active-power-phase-b", Attributes::ActivePowerPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "active-power-min-phase-b", Attributes::ActivePowerMinPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "active-power-max-phase-b", Attributes::ActivePowerMaxPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "reactive-power-phase-b", Attributes::ReactivePowerPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "apparent-power-phase-b", Attributes::ApparentPowerPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "power-factor-phase-b", Attributes::PowerFactorPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-voltage-measurement-period-phase-b", - Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-over-voltage-counter-phase-b", - Attributes::AverageRmsOverVoltageCounterPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-under-voltage-counter-phase-b", - Attributes::AverageRmsUnderVoltageCounterPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-extreme-over-voltage-period-phase-b", - Attributes::RmsExtremeOverVoltagePeriodPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-extreme-under-voltage-period-phase-b", - Attributes::RmsExtremeUnderVoltagePeriodPhaseB::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-sag-period-phase-b", Attributes::RmsVoltageSagPeriodPhaseB::Id, - credsIssuerConfig), // - make_unique(Id, "rms-voltage-swell-period-phase-b", Attributes::RmsVoltageSwellPeriodPhaseB::Id, - credsIssuerConfig), // - make_unique(Id, "line-current-phase-c", Attributes::LineCurrentPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "active-current-phase-c", Attributes::ActiveCurrentPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "reactive-current-phase-c", Attributes::ReactiveCurrentPhaseC::Id, - credsIssuerConfig), // - make_unique(Id, "rms-voltage-phase-c", Attributes::RmsVoltagePhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-min-phase-c", Attributes::RmsVoltageMinPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-max-phase-c", Attributes::RmsVoltageMaxPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-phase-c", Attributes::RmsCurrentPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-min-phase-c", Attributes::RmsCurrentMinPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-current-max-phase-c", Attributes::RmsCurrentMaxPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "active-power-phase-c", Attributes::ActivePowerPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "active-power-min-phase-c", Attributes::ActivePowerMinPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "active-power-max-phase-c", Attributes::ActivePowerMaxPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "reactive-power-phase-c", Attributes::ReactivePowerPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "apparent-power-phase-c", Attributes::ApparentPowerPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "power-factor-phase-c", Attributes::PowerFactorPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-voltage-measurement-period-phase-c", - Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-over-voltage-counter-phase-c", - Attributes::AverageRmsOverVoltageCounterPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "average-rms-under-voltage-counter-phase-c", - Attributes::AverageRmsUnderVoltageCounterPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-extreme-over-voltage-period-phase-c", - Attributes::RmsExtremeOverVoltagePeriodPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-extreme-under-voltage-period-phase-c", - Attributes::RmsExtremeUnderVoltagePeriodPhaseC::Id, credsIssuerConfig), // - make_unique(Id, "rms-voltage-sag-period-phase-c", Attributes::RmsVoltageSagPeriodPhaseC::Id, - credsIssuerConfig), // - make_unique(Id, "rms-voltage-swell-period-phase-c", Attributes::RmsVoltageSwellPeriodPhaseC::Id, - credsIssuerConfig), // - make_unique(Id, "generated-command-list", Attributes::GeneratedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "accepted-command-list", Attributes::AcceptedCommandList::Id, credsIssuerConfig), // - make_unique(Id, "event-list", Attributes::EventList::Id, credsIssuerConfig), // - make_unique(Id, "attribute-list", Attributes::AttributeList::Id, credsIssuerConfig), // - make_unique(Id, "feature-map", Attributes::FeatureMap::Id, credsIssuerConfig), // - make_unique(Id, "cluster-revision", Attributes::ClusterRevision::Id, credsIssuerConfig), // - // - // Events - // - make_unique(Id, credsIssuerConfig), // - make_unique(Id, credsIssuerConfig), // - }; - - commands.RegisterCluster(clusterName, clusterCommands); -} void registerClusterUnitTesting(Commands & commands, CredentialIssuerCommands * credsIssuerConfig) { using namespace chip::app::Clusters::UnitTesting; @@ -28230,9 +26914,7 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterIdentify(commands, credsIssuerConfig); registerClusterGroups(commands, credsIssuerConfig); registerClusterOnOff(commands, credsIssuerConfig); - registerClusterOnOffSwitchConfiguration(commands, credsIssuerConfig); registerClusterLevelControl(commands, credsIssuerConfig); - registerClusterBinaryInputBasic(commands, credsIssuerConfig); registerClusterPulseWidthModulation(commands, credsIssuerConfig); registerClusterDescriptor(commands, credsIssuerConfig); registerClusterBinding(commands, credsIssuerConfig); @@ -28306,7 +26988,6 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterDeviceEnergyManagementMode(commands, credsIssuerConfig); registerClusterDoorLock(commands, credsIssuerConfig); registerClusterWindowCovering(commands, credsIssuerConfig); - registerClusterBarrierControl(commands, credsIssuerConfig); registerClusterServiceArea(commands, credsIssuerConfig); registerClusterPumpConfigurationAndControl(commands, credsIssuerConfig); registerClusterThermostat(commands, credsIssuerConfig); @@ -28349,7 +27030,6 @@ void registerClusters(Commands & commands, CredentialIssuerCommands * credsIssue registerClusterContentAppObserver(commands, credsIssuerConfig); registerClusterEcosystemInformation(commands, credsIssuerConfig); registerClusterCommissionerControl(commands, credsIssuerConfig); - registerClusterElectricalMeasurement(commands, credsIssuerConfig); registerClusterUnitTesting(commands, credsIssuerConfig); registerClusterFaultInjection(commands, credsIssuerConfig); registerClusterSampleMei(commands, credsIssuerConfig); diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp index 8def02781d4b9a..e51e3eaa80e166 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.cpp @@ -8727,31 +8727,6 @@ CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, DataModelLogger::LogString(indent, "}"); return CHIP_NO_ERROR; } -CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, - const ElectricalMeasurement::Commands::GetProfileInfoResponseCommand::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("profileCount", indent + 1, value.profileCount)); - ReturnErrorOnFailure(DataModelLogger::LogValue("profileIntervalPeriod", indent + 1, value.profileIntervalPeriod)); - ReturnErrorOnFailure(DataModelLogger::LogValue("maxNumberOfIntervals", indent + 1, value.maxNumberOfIntervals)); - ReturnErrorOnFailure(DataModelLogger::LogValue("listOfAttributes", indent + 1, value.listOfAttributes)); - DataModelLogger::LogString(indent, "}"); - return CHIP_NO_ERROR; -} -CHIP_ERROR -DataModelLogger::LogValue(const char * label, size_t indent, - const ElectricalMeasurement::Commands::GetMeasurementProfileResponseCommand::DecodableType & value) -{ - DataModelLogger::LogString(label, indent, "{"); - ReturnErrorOnFailure(DataModelLogger::LogValue("startTime", indent + 1, value.startTime)); - ReturnErrorOnFailure(DataModelLogger::LogValue("status", indent + 1, value.status)); - ReturnErrorOnFailure(DataModelLogger::LogValue("profileIntervalPeriod", indent + 1, value.profileIntervalPeriod)); - ReturnErrorOnFailure(DataModelLogger::LogValue("numberOfIntervalsDelivered", indent + 1, value.numberOfIntervalsDelivered)); - ReturnErrorOnFailure(DataModelLogger::LogValue("attributeId", indent + 1, value.attributeId)); - ReturnErrorOnFailure(DataModelLogger::LogValue("intervals", indent + 1, value.intervals)); - DataModelLogger::LogString(indent, "}"); - return CHIP_NO_ERROR; -} CHIP_ERROR DataModelLogger::LogValue(const char * label, size_t indent, const UnitTesting::Commands::TestSpecificResponse::DecodableType & value) { @@ -9089,52 +9064,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case OnOffSwitchConfiguration::Id: { - switch (path.mAttributeId) - { - case OnOffSwitchConfiguration::Attributes::SwitchType::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("switch type", 1, value); - } - case OnOffSwitchConfiguration::Attributes::SwitchActions::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("switch actions", 1, value); - } - case OnOffSwitchConfiguration::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, OnOffSwitchConfiguration::Id); - } - case OnOffSwitchConfiguration::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, OnOffSwitchConfiguration::Id); - } - case OnOffSwitchConfiguration::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); - } - case OnOffSwitchConfiguration::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, OnOffSwitchConfiguration::Id); - } - case OnOffSwitchConfiguration::Attributes::FeatureMap::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); - } - case OnOffSwitchConfiguration::Attributes::ClusterRevision::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); - } - } - break; - } case LevelControl::Id: { switch (path.mAttributeId) { @@ -9241,87 +9170,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case BinaryInputBasic::Id: { - switch (path.mAttributeId) - { - case BinaryInputBasic::Attributes::ActiveText::Id: { - chip::CharSpan value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("active text", 1, value); - } - case BinaryInputBasic::Attributes::Description::Id: { - chip::CharSpan value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("description", 1, value); - } - case BinaryInputBasic::Attributes::InactiveText::Id: { - chip::CharSpan value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("inactive text", 1, value); - } - case BinaryInputBasic::Attributes::OutOfService::Id: { - bool value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("out of service", 1, value); - } - case BinaryInputBasic::Attributes::Polarity::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("polarity", 1, value); - } - case BinaryInputBasic::Attributes::PresentValue::Id: { - bool value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("present value", 1, value); - } - case BinaryInputBasic::Attributes::Reliability::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("reliability", 1, value); - } - case BinaryInputBasic::Attributes::StatusFlags::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("status flags", 1, value); - } - case BinaryInputBasic::Attributes::ApplicationType::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("application type", 1, value); - } - case BinaryInputBasic::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BinaryInputBasic::Id); - } - case BinaryInputBasic::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BinaryInputBasic::Id); - } - case BinaryInputBasic::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); - } - case BinaryInputBasic::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, BinaryInputBasic::Id); - } - case BinaryInputBasic::Attributes::FeatureMap::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); - } - case BinaryInputBasic::Attributes::ClusterRevision::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); - } - } - break; - } case PulseWidthModulation::Id: { switch (path.mAttributeId) { @@ -14742,92 +14590,6 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case BarrierControl::Id: { - switch (path.mAttributeId) - { - case BarrierControl::Attributes::BarrierMovingState::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("barrier moving state", 1, value); - } - case BarrierControl::Attributes::BarrierSafetyStatus::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("barrier safety status", 1, value); - } - case BarrierControl::Attributes::BarrierCapabilities::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("barrier capabilities", 1, value); - } - case BarrierControl::Attributes::BarrierOpenEvents::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("barrier open events", 1, value); - } - case BarrierControl::Attributes::BarrierCloseEvents::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("barrier close events", 1, value); - } - case BarrierControl::Attributes::BarrierCommandOpenEvents::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("barrier command open events", 1, value); - } - case BarrierControl::Attributes::BarrierCommandCloseEvents::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("barrier command close events", 1, value); - } - case BarrierControl::Attributes::BarrierOpenPeriod::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("barrier open period", 1, value); - } - case BarrierControl::Attributes::BarrierClosePeriod::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("barrier close period", 1, value); - } - case BarrierControl::Attributes::BarrierPosition::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("barrier position", 1, value); - } - case BarrierControl::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, BarrierControl::Id); - } - case BarrierControl::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, BarrierControl::Id); - } - case BarrierControl::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); - } - case BarrierControl::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, BarrierControl::Id); - } - case BarrierControl::Attributes::FeatureMap::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); - } - case BarrierControl::Attributes::ClusterRevision::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); - } - } - break; - } case ServiceArea::Id: { switch (path.mAttributeId) { @@ -18246,809 +18008,133 @@ CHIP_ERROR DataModelLogger::LogAttribute(const chip::app::ConcreteDataAttributeP } break; } - case ElectricalMeasurement::Id: { + case UnitTesting::Id: { switch (path.mAttributeId) { - case ElectricalMeasurement::Attributes::MeasurementType::Id: { - uint32_t value; + case UnitTesting::Attributes::Boolean::Id: { + bool value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("measurement type", 1, value); + return DataModelLogger::LogValue("boolean", 1, value); } - case ElectricalMeasurement::Attributes::DcVoltage::Id: { - int16_t value; + case UnitTesting::Attributes::Bitmap8::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("dc voltage", 1, value); + return DataModelLogger::LogValue("bitmap8", 1, value); } - case ElectricalMeasurement::Attributes::DcVoltageMin::Id: { - int16_t value; + case UnitTesting::Attributes::Bitmap16::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("dc voltage min", 1, value); + return DataModelLogger::LogValue("bitmap16", 1, value); } - case ElectricalMeasurement::Attributes::DcVoltageMax::Id: { - int16_t value; + case UnitTesting::Attributes::Bitmap32::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("dc voltage max", 1, value); + return DataModelLogger::LogValue("bitmap32", 1, value); } - case ElectricalMeasurement::Attributes::DcCurrent::Id: { - int16_t value; + case UnitTesting::Attributes::Bitmap64::Id: { + chip::BitMask value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("dc current", 1, value); + return DataModelLogger::LogValue("bitmap64", 1, value); } - case ElectricalMeasurement::Attributes::DcCurrentMin::Id: { - int16_t value; + case UnitTesting::Attributes::Int8u::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("dc current min", 1, value); + return DataModelLogger::LogValue("int8u", 1, value); } - case ElectricalMeasurement::Attributes::DcCurrentMax::Id: { - int16_t value; + case UnitTesting::Attributes::Int16u::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("dc current max", 1, value); + return DataModelLogger::LogValue("int16u", 1, value); } - case ElectricalMeasurement::Attributes::DcPower::Id: { - int16_t value; + case UnitTesting::Attributes::Int24u::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("dc power", 1, value); + return DataModelLogger::LogValue("int24u", 1, value); } - case ElectricalMeasurement::Attributes::DcPowerMin::Id: { - int16_t value; + case UnitTesting::Attributes::Int32u::Id: { + uint32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("dc power min", 1, value); + return DataModelLogger::LogValue("int32u", 1, value); } - case ElectricalMeasurement::Attributes::DcPowerMax::Id: { - int16_t value; + case UnitTesting::Attributes::Int40u::Id: { + uint64_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("dc power max", 1, value); + return DataModelLogger::LogValue("int40u", 1, value); } - case ElectricalMeasurement::Attributes::DcVoltageMultiplier::Id: { - uint16_t value; + case UnitTesting::Attributes::Int48u::Id: { + uint64_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("dc voltage multiplier", 1, value); + return DataModelLogger::LogValue("int48u", 1, value); } - case ElectricalMeasurement::Attributes::DcVoltageDivisor::Id: { - uint16_t value; + case UnitTesting::Attributes::Int56u::Id: { + uint64_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("dc voltage divisor", 1, value); + return DataModelLogger::LogValue("int56u", 1, value); } - case ElectricalMeasurement::Attributes::DcCurrentMultiplier::Id: { - uint16_t value; + case UnitTesting::Attributes::Int64u::Id: { + uint64_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("dc current multiplier", 1, value); + return DataModelLogger::LogValue("int64u", 1, value); } - case ElectricalMeasurement::Attributes::DcCurrentDivisor::Id: { - uint16_t value; + case UnitTesting::Attributes::Int8s::Id: { + int8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("dc current divisor", 1, value); + return DataModelLogger::LogValue("int8s", 1, value); } - case ElectricalMeasurement::Attributes::DcPowerMultiplier::Id: { - uint16_t value; + case UnitTesting::Attributes::Int16s::Id: { + int16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("dc power multiplier", 1, value); + return DataModelLogger::LogValue("int16s", 1, value); } - case ElectricalMeasurement::Attributes::DcPowerDivisor::Id: { - uint16_t value; + case UnitTesting::Attributes::Int24s::Id: { + int32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("dc power divisor", 1, value); + return DataModelLogger::LogValue("int24s", 1, value); } - case ElectricalMeasurement::Attributes::AcFrequency::Id: { - uint16_t value; + case UnitTesting::Attributes::Int32s::Id: { + int32_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac frequency", 1, value); + return DataModelLogger::LogValue("int32s", 1, value); } - case ElectricalMeasurement::Attributes::AcFrequencyMin::Id: { - uint16_t value; + case UnitTesting::Attributes::Int40s::Id: { + int64_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac frequency min", 1, value); + return DataModelLogger::LogValue("int40s", 1, value); } - case ElectricalMeasurement::Attributes::AcFrequencyMax::Id: { - uint16_t value; + case UnitTesting::Attributes::Int48s::Id: { + int64_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac frequency max", 1, value); + return DataModelLogger::LogValue("int48s", 1, value); } - case ElectricalMeasurement::Attributes::NeutralCurrent::Id: { - uint16_t value; + case UnitTesting::Attributes::Int56s::Id: { + int64_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("neutral current", 1, value); + return DataModelLogger::LogValue("int56s", 1, value); } - case ElectricalMeasurement::Attributes::TotalActivePower::Id: { - int32_t value; + case UnitTesting::Attributes::Int64s::Id: { + int64_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("total active power", 1, value); + return DataModelLogger::LogValue("int64s", 1, value); } - case ElectricalMeasurement::Attributes::TotalReactivePower::Id: { - int32_t value; + case UnitTesting::Attributes::Enum8::Id: { + uint8_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("total reactive power", 1, value); + return DataModelLogger::LogValue("enum8", 1, value); } - case ElectricalMeasurement::Attributes::TotalApparentPower::Id: { - uint32_t value; + case UnitTesting::Attributes::Enum16::Id: { + uint16_t value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("total apparent power", 1, value); + return DataModelLogger::LogValue("enum16", 1, value); } - case ElectricalMeasurement::Attributes::Measured1stHarmonicCurrent::Id: { - int16_t value; + case UnitTesting::Attributes::FloatSingle::Id: { + float value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("measured 1st harmonic current", 1, value); + return DataModelLogger::LogValue("float_single", 1, value); } - case ElectricalMeasurement::Attributes::Measured3rdHarmonicCurrent::Id: { - int16_t value; + case UnitTesting::Attributes::FloatDouble::Id: { + double value; ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("measured 3rd harmonic current", 1, value); - } - case ElectricalMeasurement::Attributes::Measured5thHarmonicCurrent::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("measured 5th harmonic current", 1, value); - } - case ElectricalMeasurement::Attributes::Measured7thHarmonicCurrent::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("measured 7th harmonic current", 1, value); - } - case ElectricalMeasurement::Attributes::Measured9thHarmonicCurrent::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("measured 9th harmonic current", 1, value); - } - case ElectricalMeasurement::Attributes::Measured11thHarmonicCurrent::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("measured 11th harmonic current", 1, value); - } - case ElectricalMeasurement::Attributes::MeasuredPhase1stHarmonicCurrent::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("measured phase 1st harmonic current", 1, value); - } - case ElectricalMeasurement::Attributes::MeasuredPhase3rdHarmonicCurrent::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("measured phase 3rd harmonic current", 1, value); - } - case ElectricalMeasurement::Attributes::MeasuredPhase5thHarmonicCurrent::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("measured phase 5th harmonic current", 1, value); - } - case ElectricalMeasurement::Attributes::MeasuredPhase7thHarmonicCurrent::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("measured phase 7th harmonic current", 1, value); - } - case ElectricalMeasurement::Attributes::MeasuredPhase9thHarmonicCurrent::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("measured phase 9th harmonic current", 1, value); - } - case ElectricalMeasurement::Attributes::MeasuredPhase11thHarmonicCurrent::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("measured phase 11th harmonic current", 1, value); - } - case ElectricalMeasurement::Attributes::AcFrequencyMultiplier::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac frequency multiplier", 1, value); - } - case ElectricalMeasurement::Attributes::AcFrequencyDivisor::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac frequency divisor", 1, value); - } - case ElectricalMeasurement::Attributes::PowerMultiplier::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("power multiplier", 1, value); - } - case ElectricalMeasurement::Attributes::PowerDivisor::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("power divisor", 1, value); - } - case ElectricalMeasurement::Attributes::HarmonicCurrentMultiplier::Id: { - int8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("harmonic current multiplier", 1, value); - } - case ElectricalMeasurement::Attributes::PhaseHarmonicCurrentMultiplier::Id: { - int8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("phase harmonic current multiplier", 1, value); - } - case ElectricalMeasurement::Attributes::InstantaneousVoltage::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("instantaneous voltage", 1, value); - } - case ElectricalMeasurement::Attributes::InstantaneousLineCurrent::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("instantaneous line current", 1, value); - } - case ElectricalMeasurement::Attributes::InstantaneousActiveCurrent::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("instantaneous active current", 1, value); - } - case ElectricalMeasurement::Attributes::InstantaneousReactiveCurrent::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("instantaneous reactive current", 1, value); - } - case ElectricalMeasurement::Attributes::InstantaneousPower::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("instantaneous power", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltage::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltageMin::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage min", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltageMax::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage max", 1, value); - } - case ElectricalMeasurement::Attributes::RmsCurrent::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms current", 1, value); - } - case ElectricalMeasurement::Attributes::RmsCurrentMin::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms current min", 1, value); - } - case ElectricalMeasurement::Attributes::RmsCurrentMax::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms current max", 1, value); - } - case ElectricalMeasurement::Attributes::ActivePower::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("active power", 1, value); - } - case ElectricalMeasurement::Attributes::ActivePowerMin::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("active power min", 1, value); - } - case ElectricalMeasurement::Attributes::ActivePowerMax::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("active power max", 1, value); - } - case ElectricalMeasurement::Attributes::ReactivePower::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("reactive power", 1, value); - } - case ElectricalMeasurement::Attributes::ApparentPower::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("apparent power", 1, value); - } - case ElectricalMeasurement::Attributes::PowerFactor::Id: { - int8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("power factor", 1, value); - } - case ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriod::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("average rms voltage measurement period", 1, value); - } - case ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounter::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("average rms under voltage counter", 1, value); - } - case ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriod::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms extreme over voltage period", 1, value); - } - case ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriod::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms extreme under voltage period", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltageSagPeriod::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage sag period", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltageSwellPeriod::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage swell period", 1, value); - } - case ElectricalMeasurement::Attributes::AcVoltageMultiplier::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac voltage multiplier", 1, value); - } - case ElectricalMeasurement::Attributes::AcVoltageDivisor::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac voltage divisor", 1, value); - } - case ElectricalMeasurement::Attributes::AcCurrentMultiplier::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac current multiplier", 1, value); - } - case ElectricalMeasurement::Attributes::AcCurrentDivisor::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac current divisor", 1, value); - } - case ElectricalMeasurement::Attributes::AcPowerMultiplier::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac power multiplier", 1, value); - } - case ElectricalMeasurement::Attributes::AcPowerDivisor::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac power divisor", 1, value); - } - case ElectricalMeasurement::Attributes::OverloadAlarmsMask::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("overload alarms mask", 1, value); - } - case ElectricalMeasurement::Attributes::VoltageOverload::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("voltage overload", 1, value); - } - case ElectricalMeasurement::Attributes::CurrentOverload::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("current overload", 1, value); - } - case ElectricalMeasurement::Attributes::AcOverloadAlarmsMask::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac overload alarms mask", 1, value); - } - case ElectricalMeasurement::Attributes::AcVoltageOverload::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac voltage overload", 1, value); - } - case ElectricalMeasurement::Attributes::AcCurrentOverload::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac current overload", 1, value); - } - case ElectricalMeasurement::Attributes::AcActivePowerOverload::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac active power overload", 1, value); - } - case ElectricalMeasurement::Attributes::AcReactivePowerOverload::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ac reactive power overload", 1, value); - } - case ElectricalMeasurement::Attributes::AverageRmsOverVoltage::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("average rms over voltage", 1, value); - } - case ElectricalMeasurement::Attributes::AverageRmsUnderVoltage::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("average rms under voltage", 1, value); - } - case ElectricalMeasurement::Attributes::RmsExtremeOverVoltage::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms extreme over voltage", 1, value); - } - case ElectricalMeasurement::Attributes::RmsExtremeUnderVoltage::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms extreme under voltage", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltageSag::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage sag", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltageSwell::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage swell", 1, value); - } - case ElectricalMeasurement::Attributes::LineCurrentPhaseB::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("line current phase b", 1, value); - } - case ElectricalMeasurement::Attributes::ActiveCurrentPhaseB::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("active current phase b", 1, value); - } - case ElectricalMeasurement::Attributes::ReactiveCurrentPhaseB::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("reactive current phase b", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltagePhaseB::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage phase b", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltageMinPhaseB::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage min phase b", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltageMaxPhaseB::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage max phase b", 1, value); - } - case ElectricalMeasurement::Attributes::RmsCurrentPhaseB::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms current phase b", 1, value); - } - case ElectricalMeasurement::Attributes::RmsCurrentMinPhaseB::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms current min phase b", 1, value); - } - case ElectricalMeasurement::Attributes::RmsCurrentMaxPhaseB::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms current max phase b", 1, value); - } - case ElectricalMeasurement::Attributes::ActivePowerPhaseB::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("active power phase b", 1, value); - } - case ElectricalMeasurement::Attributes::ActivePowerMinPhaseB::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("active power min phase b", 1, value); - } - case ElectricalMeasurement::Attributes::ActivePowerMaxPhaseB::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("active power max phase b", 1, value); - } - case ElectricalMeasurement::Attributes::ReactivePowerPhaseB::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("reactive power phase b", 1, value); - } - case ElectricalMeasurement::Attributes::ApparentPowerPhaseB::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("apparent power phase b", 1, value); - } - case ElectricalMeasurement::Attributes::PowerFactorPhaseB::Id: { - int8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("power factor phase b", 1, value); - } - case ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("average rms voltage measurement period phase b", 1, value); - } - case ElectricalMeasurement::Attributes::AverageRmsOverVoltageCounterPhaseB::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("average rms over voltage counter phase b", 1, value); - } - case ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounterPhaseB::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("average rms under voltage counter phase b", 1, value); - } - case ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriodPhaseB::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms extreme over voltage period phase b", 1, value); - } - case ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriodPhaseB::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms extreme under voltage period phase b", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltageSagPeriodPhaseB::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage sag period phase b", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltageSwellPeriodPhaseB::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage swell period phase b", 1, value); - } - case ElectricalMeasurement::Attributes::LineCurrentPhaseC::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("line current phase c", 1, value); - } - case ElectricalMeasurement::Attributes::ActiveCurrentPhaseC::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("active current phase c", 1, value); - } - case ElectricalMeasurement::Attributes::ReactiveCurrentPhaseC::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("reactive current phase c", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltagePhaseC::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage phase c", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltageMinPhaseC::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage min phase c", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltageMaxPhaseC::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage max phase c", 1, value); - } - case ElectricalMeasurement::Attributes::RmsCurrentPhaseC::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms current phase c", 1, value); - } - case ElectricalMeasurement::Attributes::RmsCurrentMinPhaseC::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms current min phase c", 1, value); - } - case ElectricalMeasurement::Attributes::RmsCurrentMaxPhaseC::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms current max phase c", 1, value); - } - case ElectricalMeasurement::Attributes::ActivePowerPhaseC::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("active power phase c", 1, value); - } - case ElectricalMeasurement::Attributes::ActivePowerMinPhaseC::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("active power min phase c", 1, value); - } - case ElectricalMeasurement::Attributes::ActivePowerMaxPhaseC::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("active power max phase c", 1, value); - } - case ElectricalMeasurement::Attributes::ReactivePowerPhaseC::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("reactive power phase c", 1, value); - } - case ElectricalMeasurement::Attributes::ApparentPowerPhaseC::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("apparent power phase c", 1, value); - } - case ElectricalMeasurement::Attributes::PowerFactorPhaseC::Id: { - int8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("power factor phase c", 1, value); - } - case ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("average rms voltage measurement period phase c", 1, value); - } - case ElectricalMeasurement::Attributes::AverageRmsOverVoltageCounterPhaseC::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("average rms over voltage counter phase c", 1, value); - } - case ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounterPhaseC::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("average rms under voltage counter phase c", 1, value); - } - case ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriodPhaseC::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms extreme over voltage period phase c", 1, value); - } - case ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriodPhaseC::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms extreme under voltage period phase c", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltageSagPeriodPhaseC::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage sag period phase c", 1, value); - } - case ElectricalMeasurement::Attributes::RmsVoltageSwellPeriodPhaseC::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("rms voltage swell period phase c", 1, value); - } - case ElectricalMeasurement::Attributes::GeneratedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogGeneratedCommandId("GeneratedCommandList", 1, value, ElectricalMeasurement::Id); - } - case ElectricalMeasurement::Attributes::AcceptedCommandList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAcceptedCommandId("AcceptedCommandList", 1, value, ElectricalMeasurement::Id); - } - case ElectricalMeasurement::Attributes::EventList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("EventList", 1, value); - } - case ElectricalMeasurement::Attributes::AttributeList::Id: { - chip::app::DataModel::DecodableList value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogAttributeId("AttributeList", 1, value, ElectricalMeasurement::Id); - } - case ElectricalMeasurement::Attributes::FeatureMap::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("FeatureMap", 1, value); - } - case ElectricalMeasurement::Attributes::ClusterRevision::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("ClusterRevision", 1, value); - } - } - break; - } - case UnitTesting::Id: { - switch (path.mAttributeId) - { - case UnitTesting::Attributes::Boolean::Id: { - bool value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("boolean", 1, value); - } - case UnitTesting::Attributes::Bitmap8::Id: { - chip::BitMask value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("bitmap8", 1, value); - } - case UnitTesting::Attributes::Bitmap16::Id: { - chip::BitMask value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("bitmap16", 1, value); - } - case UnitTesting::Attributes::Bitmap32::Id: { - chip::BitMask value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("bitmap32", 1, value); - } - case UnitTesting::Attributes::Bitmap64::Id: { - chip::BitMask value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("bitmap64", 1, value); - } - case UnitTesting::Attributes::Int8u::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int8u", 1, value); - } - case UnitTesting::Attributes::Int16u::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int16u", 1, value); - } - case UnitTesting::Attributes::Int24u::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int24u", 1, value); - } - case UnitTesting::Attributes::Int32u::Id: { - uint32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int32u", 1, value); - } - case UnitTesting::Attributes::Int40u::Id: { - uint64_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int40u", 1, value); - } - case UnitTesting::Attributes::Int48u::Id: { - uint64_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int48u", 1, value); - } - case UnitTesting::Attributes::Int56u::Id: { - uint64_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int56u", 1, value); - } - case UnitTesting::Attributes::Int64u::Id: { - uint64_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int64u", 1, value); - } - case UnitTesting::Attributes::Int8s::Id: { - int8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int8s", 1, value); - } - case UnitTesting::Attributes::Int16s::Id: { - int16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int16s", 1, value); - } - case UnitTesting::Attributes::Int24s::Id: { - int32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int24s", 1, value); - } - case UnitTesting::Attributes::Int32s::Id: { - int32_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int32s", 1, value); - } - case UnitTesting::Attributes::Int40s::Id: { - int64_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int40s", 1, value); - } - case UnitTesting::Attributes::Int48s::Id: { - int64_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int48s", 1, value); - } - case UnitTesting::Attributes::Int56s::Id: { - int64_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int56s", 1, value); - } - case UnitTesting::Attributes::Int64s::Id: { - int64_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("int64s", 1, value); - } - case UnitTesting::Attributes::Enum8::Id: { - uint8_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("enum8", 1, value); - } - case UnitTesting::Attributes::Enum16::Id: { - uint16_t value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("enum16", 1, value); - } - case UnitTesting::Attributes::FloatSingle::Id: { - float value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("float_single", 1, value); - } - case UnitTesting::Attributes::FloatDouble::Id: { - double value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("float_double", 1, value); + return DataModelLogger::LogValue("float_double", 1, value); } case UnitTesting::Attributes::OctetString::Id: { chip::ByteSpan value; @@ -20098,22 +19184,6 @@ CHIP_ERROR DataModelLogger::LogCommand(const chip::app::ConcreteCommandPath & pa } break; } - case ElectricalMeasurement::Id: { - switch (path.mCommandId) - { - case ElectricalMeasurement::Commands::GetProfileInfoResponseCommand::Id: { - ElectricalMeasurement::Commands::GetProfileInfoResponseCommand::DecodableType value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GetProfileInfoResponseCommand", 1, value); - } - case ElectricalMeasurement::Commands::GetMeasurementProfileResponseCommand::Id: { - ElectricalMeasurement::Commands::GetMeasurementProfileResponseCommand::DecodableType value; - ReturnErrorOnFailure(chip::app::DataModel::Decode(*data, value)); - return DataModelLogger::LogValue("GetMeasurementProfileResponseCommand", 1, value); - } - } - break; - } case UnitTesting::Id: { switch (path.mCommandId) { diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h index ce1aa0b46f01da..8ac710f0c27a0d 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/DataModelLogger.h @@ -847,12 +847,6 @@ LogValue(const char * label, size_t indent, static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::CommissionerControl::Commands::ReverseOpenCommissioningWindow::DecodableType & value); -static CHIP_ERROR -LogValue(const char * label, size_t indent, - const chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoResponseCommand::DecodableType & value); -static CHIP_ERROR -LogValue(const char * label, size_t indent, - const chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileResponseCommand::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, const chip::app::Clusters::UnitTesting::Commands::TestSpecificResponse::DecodableType & value); static CHIP_ERROR LogValue(const char * label, size_t indent, diff --git a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp index 8f320e64e682b8..73c5f1ef371fa5 100644 --- a/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp +++ b/zzz_generated/chip-tool/zap-generated/cluster/logging/EntryToText.cpp @@ -31,12 +31,8 @@ char const * ClusterIdToText(chip::ClusterId id) return "Groups"; case chip::app::Clusters::OnOff::Id: return "OnOff"; - case chip::app::Clusters::OnOffSwitchConfiguration::Id: - return "OnOffSwitchConfiguration"; case chip::app::Clusters::LevelControl::Id: return "LevelControl"; - case chip::app::Clusters::BinaryInputBasic::Id: - return "BinaryInputBasic"; case chip::app::Clusters::PulseWidthModulation::Id: return "PulseWidthModulation"; case chip::app::Clusters::Descriptor::Id: @@ -183,8 +179,6 @@ char const * ClusterIdToText(chip::ClusterId id) return "DoorLock"; case chip::app::Clusters::WindowCovering::Id: return "WindowCovering"; - case chip::app::Clusters::BarrierControl::Id: - return "BarrierControl"; case chip::app::Clusters::ServiceArea::Id: return "ServiceArea"; case chip::app::Clusters::PumpConfigurationAndControl::Id: @@ -269,8 +263,6 @@ char const * ClusterIdToText(chip::ClusterId id) return "EcosystemInformation"; case chip::app::Clusters::CommissionerControl::Id: return "CommissionerControl"; - case chip::app::Clusters::ElectricalMeasurement::Id: - return "ElectricalMeasurement"; case chip::app::Clusters::UnitTesting::Id: return "UnitTesting"; case chip::app::Clusters::FaultInjection::Id: @@ -359,29 +351,6 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "Unknown"; } } - case chip::app::Clusters::OnOffSwitchConfiguration::Id: { - switch (id) - { - case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchType::Id: - return "SwitchType"; - case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::SwitchActions::Id: - return "SwitchActions"; - case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::GeneratedCommandList::Id: - return "GeneratedCommandList"; - case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::AcceptedCommandList::Id: - return "AcceptedCommandList"; - case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::EventList::Id: - return "EventList"; - case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::AttributeList::Id: - return "AttributeList"; - case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::FeatureMap::Id: - return "FeatureMap"; - case chip::app::Clusters::OnOffSwitchConfiguration::Attributes::ClusterRevision::Id: - return "ClusterRevision"; - default: - return "Unknown"; - } - } case chip::app::Clusters::LevelControl::Id: { switch (id) { @@ -429,43 +398,6 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "Unknown"; } } - case chip::app::Clusters::BinaryInputBasic::Id: { - switch (id) - { - case chip::app::Clusters::BinaryInputBasic::Attributes::ActiveText::Id: - return "ActiveText"; - case chip::app::Clusters::BinaryInputBasic::Attributes::Description::Id: - return "Description"; - case chip::app::Clusters::BinaryInputBasic::Attributes::InactiveText::Id: - return "InactiveText"; - case chip::app::Clusters::BinaryInputBasic::Attributes::OutOfService::Id: - return "OutOfService"; - case chip::app::Clusters::BinaryInputBasic::Attributes::Polarity::Id: - return "Polarity"; - case chip::app::Clusters::BinaryInputBasic::Attributes::PresentValue::Id: - return "PresentValue"; - case chip::app::Clusters::BinaryInputBasic::Attributes::Reliability::Id: - return "Reliability"; - case chip::app::Clusters::BinaryInputBasic::Attributes::StatusFlags::Id: - return "StatusFlags"; - case chip::app::Clusters::BinaryInputBasic::Attributes::ApplicationType::Id: - return "ApplicationType"; - case chip::app::Clusters::BinaryInputBasic::Attributes::GeneratedCommandList::Id: - return "GeneratedCommandList"; - case chip::app::Clusters::BinaryInputBasic::Attributes::AcceptedCommandList::Id: - return "AcceptedCommandList"; - case chip::app::Clusters::BinaryInputBasic::Attributes::EventList::Id: - return "EventList"; - case chip::app::Clusters::BinaryInputBasic::Attributes::AttributeList::Id: - return "AttributeList"; - case chip::app::Clusters::BinaryInputBasic::Attributes::FeatureMap::Id: - return "FeatureMap"; - case chip::app::Clusters::BinaryInputBasic::Attributes::ClusterRevision::Id: - return "ClusterRevision"; - default: - return "Unknown"; - } - } case chip::app::Clusters::PulseWidthModulation::Id: { switch (id) { @@ -2937,45 +2869,6 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "Unknown"; } } - case chip::app::Clusters::BarrierControl::Id: { - switch (id) - { - case chip::app::Clusters::BarrierControl::Attributes::BarrierMovingState::Id: - return "BarrierMovingState"; - case chip::app::Clusters::BarrierControl::Attributes::BarrierSafetyStatus::Id: - return "BarrierSafetyStatus"; - case chip::app::Clusters::BarrierControl::Attributes::BarrierCapabilities::Id: - return "BarrierCapabilities"; - case chip::app::Clusters::BarrierControl::Attributes::BarrierOpenEvents::Id: - return "BarrierOpenEvents"; - case chip::app::Clusters::BarrierControl::Attributes::BarrierCloseEvents::Id: - return "BarrierCloseEvents"; - case chip::app::Clusters::BarrierControl::Attributes::BarrierCommandOpenEvents::Id: - return "BarrierCommandOpenEvents"; - case chip::app::Clusters::BarrierControl::Attributes::BarrierCommandCloseEvents::Id: - return "BarrierCommandCloseEvents"; - case chip::app::Clusters::BarrierControl::Attributes::BarrierOpenPeriod::Id: - return "BarrierOpenPeriod"; - case chip::app::Clusters::BarrierControl::Attributes::BarrierClosePeriod::Id: - return "BarrierClosePeriod"; - case chip::app::Clusters::BarrierControl::Attributes::BarrierPosition::Id: - return "BarrierPosition"; - case chip::app::Clusters::BarrierControl::Attributes::GeneratedCommandList::Id: - return "GeneratedCommandList"; - case chip::app::Clusters::BarrierControl::Attributes::AcceptedCommandList::Id: - return "AcceptedCommandList"; - case chip::app::Clusters::BarrierControl::Attributes::EventList::Id: - return "EventList"; - case chip::app::Clusters::BarrierControl::Attributes::AttributeList::Id: - return "AttributeList"; - case chip::app::Clusters::BarrierControl::Attributes::FeatureMap::Id: - return "FeatureMap"; - case chip::app::Clusters::BarrierControl::Attributes::ClusterRevision::Id: - return "ClusterRevision"; - default: - return "Unknown"; - } - } case chip::app::Clusters::ServiceArea::Id: { switch (id) { @@ -4526,281 +4419,6 @@ char const * AttributeIdToText(chip::ClusterId cluster, chip::AttributeId id) return "Unknown"; } } - case chip::app::Clusters::ElectricalMeasurement::Id: { - switch (id) - { - case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasurementType::Id: - return "MeasurementType"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::DcVoltage::Id: - return "DcVoltage"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::DcVoltageMin::Id: - return "DcVoltageMin"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::DcVoltageMax::Id: - return "DcVoltageMax"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::DcCurrent::Id: - return "DcCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::DcCurrentMin::Id: - return "DcCurrentMin"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::DcCurrentMax::Id: - return "DcCurrentMax"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::DcPower::Id: - return "DcPower"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::DcPowerMin::Id: - return "DcPowerMin"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::DcPowerMax::Id: - return "DcPowerMax"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::DcVoltageMultiplier::Id: - return "DcVoltageMultiplier"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::DcVoltageDivisor::Id: - return "DcVoltageDivisor"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::DcCurrentMultiplier::Id: - return "DcCurrentMultiplier"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::DcCurrentDivisor::Id: - return "DcCurrentDivisor"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::DcPowerMultiplier::Id: - return "DcPowerMultiplier"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::DcPowerDivisor::Id: - return "DcPowerDivisor"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcFrequency::Id: - return "AcFrequency"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcFrequencyMin::Id: - return "AcFrequencyMin"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcFrequencyMax::Id: - return "AcFrequencyMax"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::NeutralCurrent::Id: - return "NeutralCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::TotalActivePower::Id: - return "TotalActivePower"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::TotalReactivePower::Id: - return "TotalReactivePower"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::TotalApparentPower::Id: - return "TotalApparentPower"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured1stHarmonicCurrent::Id: - return "Measured1stHarmonicCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured3rdHarmonicCurrent::Id: - return "Measured3rdHarmonicCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured5thHarmonicCurrent::Id: - return "Measured5thHarmonicCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured7thHarmonicCurrent::Id: - return "Measured7thHarmonicCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured9thHarmonicCurrent::Id: - return "Measured9thHarmonicCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::Measured11thHarmonicCurrent::Id: - return "Measured11thHarmonicCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase1stHarmonicCurrent::Id: - return "MeasuredPhase1stHarmonicCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase3rdHarmonicCurrent::Id: - return "MeasuredPhase3rdHarmonicCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase5thHarmonicCurrent::Id: - return "MeasuredPhase5thHarmonicCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase7thHarmonicCurrent::Id: - return "MeasuredPhase7thHarmonicCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase9thHarmonicCurrent::Id: - return "MeasuredPhase9thHarmonicCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::MeasuredPhase11thHarmonicCurrent::Id: - return "MeasuredPhase11thHarmonicCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcFrequencyMultiplier::Id: - return "AcFrequencyMultiplier"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcFrequencyDivisor::Id: - return "AcFrequencyDivisor"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::PowerMultiplier::Id: - return "PowerMultiplier"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::PowerDivisor::Id: - return "PowerDivisor"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::HarmonicCurrentMultiplier::Id: - return "HarmonicCurrentMultiplier"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::PhaseHarmonicCurrentMultiplier::Id: - return "PhaseHarmonicCurrentMultiplier"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::InstantaneousVoltage::Id: - return "InstantaneousVoltage"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::InstantaneousLineCurrent::Id: - return "InstantaneousLineCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::InstantaneousActiveCurrent::Id: - return "InstantaneousActiveCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::InstantaneousReactiveCurrent::Id: - return "InstantaneousReactiveCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::InstantaneousPower::Id: - return "InstantaneousPower"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltage::Id: - return "RmsVoltage"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMin::Id: - return "RmsVoltageMin"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMax::Id: - return "RmsVoltageMax"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrent::Id: - return "RmsCurrent"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMin::Id: - return "RmsCurrentMin"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMax::Id: - return "RmsCurrentMax"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePower::Id: - return "ActivePower"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMin::Id: - return "ActivePowerMin"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMax::Id: - return "ActivePowerMax"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ReactivePower::Id: - return "ReactivePower"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ApparentPower::Id: - return "ApparentPower"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::PowerFactor::Id: - return "PowerFactor"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriod::Id: - return "AverageRmsVoltageMeasurementPeriod"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounter::Id: - return "AverageRmsUnderVoltageCounter"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriod::Id: - return "RmsExtremeOverVoltagePeriod"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriod::Id: - return "RmsExtremeUnderVoltagePeriod"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSagPeriod::Id: - return "RmsVoltageSagPeriod"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSwellPeriod::Id: - return "RmsVoltageSwellPeriod"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcVoltageMultiplier::Id: - return "AcVoltageMultiplier"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcVoltageDivisor::Id: - return "AcVoltageDivisor"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcCurrentMultiplier::Id: - return "AcCurrentMultiplier"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcCurrentDivisor::Id: - return "AcCurrentDivisor"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcPowerMultiplier::Id: - return "AcPowerMultiplier"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcPowerDivisor::Id: - return "AcPowerDivisor"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::OverloadAlarmsMask::Id: - return "OverloadAlarmsMask"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::VoltageOverload::Id: - return "VoltageOverload"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::CurrentOverload::Id: - return "CurrentOverload"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcOverloadAlarmsMask::Id: - return "AcOverloadAlarmsMask"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcVoltageOverload::Id: - return "AcVoltageOverload"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcCurrentOverload::Id: - return "AcCurrentOverload"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcActivePowerOverload::Id: - return "AcActivePowerOverload"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcReactivePowerOverload::Id: - return "AcReactivePowerOverload"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsOverVoltage::Id: - return "AverageRmsOverVoltage"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsUnderVoltage::Id: - return "AverageRmsUnderVoltage"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeOverVoltage::Id: - return "RmsExtremeOverVoltage"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeUnderVoltage::Id: - return "RmsExtremeUnderVoltage"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSag::Id: - return "RmsVoltageSag"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSwell::Id: - return "RmsVoltageSwell"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::LineCurrentPhaseB::Id: - return "LineCurrentPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ActiveCurrentPhaseB::Id: - return "ActiveCurrentPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ReactiveCurrentPhaseB::Id: - return "ReactiveCurrentPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltagePhaseB::Id: - return "RmsVoltagePhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMinPhaseB::Id: - return "RmsVoltageMinPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMaxPhaseB::Id: - return "RmsVoltageMaxPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentPhaseB::Id: - return "RmsCurrentPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMinPhaseB::Id: - return "RmsCurrentMinPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMaxPhaseB::Id: - return "RmsCurrentMaxPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerPhaseB::Id: - return "ActivePowerPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMinPhaseB::Id: - return "ActivePowerMinPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMaxPhaseB::Id: - return "ActivePowerMaxPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ReactivePowerPhaseB::Id: - return "ReactivePowerPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ApparentPowerPhaseB::Id: - return "ApparentPowerPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::PowerFactorPhaseB::Id: - return "PowerFactorPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriodPhaseB::Id: - return "AverageRmsVoltageMeasurementPeriodPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsOverVoltageCounterPhaseB::Id: - return "AverageRmsOverVoltageCounterPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounterPhaseB::Id: - return "AverageRmsUnderVoltageCounterPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriodPhaseB::Id: - return "RmsExtremeOverVoltagePeriodPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriodPhaseB::Id: - return "RmsExtremeUnderVoltagePeriodPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSagPeriodPhaseB::Id: - return "RmsVoltageSagPeriodPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSwellPeriodPhaseB::Id: - return "RmsVoltageSwellPeriodPhaseB"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::LineCurrentPhaseC::Id: - return "LineCurrentPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ActiveCurrentPhaseC::Id: - return "ActiveCurrentPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ReactiveCurrentPhaseC::Id: - return "ReactiveCurrentPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltagePhaseC::Id: - return "RmsVoltagePhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMinPhaseC::Id: - return "RmsVoltageMinPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageMaxPhaseC::Id: - return "RmsVoltageMaxPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentPhaseC::Id: - return "RmsCurrentPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMinPhaseC::Id: - return "RmsCurrentMinPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsCurrentMaxPhaseC::Id: - return "RmsCurrentMaxPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerPhaseC::Id: - return "ActivePowerPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMinPhaseC::Id: - return "ActivePowerMinPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ActivePowerMaxPhaseC::Id: - return "ActivePowerMaxPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ReactivePowerPhaseC::Id: - return "ReactivePowerPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ApparentPowerPhaseC::Id: - return "ApparentPowerPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::PowerFactorPhaseC::Id: - return "PowerFactorPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsVoltageMeasurementPeriodPhaseC::Id: - return "AverageRmsVoltageMeasurementPeriodPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsOverVoltageCounterPhaseC::Id: - return "AverageRmsOverVoltageCounterPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AverageRmsUnderVoltageCounterPhaseC::Id: - return "AverageRmsUnderVoltageCounterPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeOverVoltagePeriodPhaseC::Id: - return "RmsExtremeOverVoltagePeriodPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsExtremeUnderVoltagePeriodPhaseC::Id: - return "RmsExtremeUnderVoltagePeriodPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSagPeriodPhaseC::Id: - return "RmsVoltageSagPeriodPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::RmsVoltageSwellPeriodPhaseC::Id: - return "RmsVoltageSwellPeriodPhaseC"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::GeneratedCommandList::Id: - return "GeneratedCommandList"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AcceptedCommandList::Id: - return "AcceptedCommandList"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::EventList::Id: - return "EventList"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::AttributeList::Id: - return "AttributeList"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::FeatureMap::Id: - return "FeatureMap"; - case chip::app::Clusters::ElectricalMeasurement::Attributes::ClusterRevision::Id: - return "ClusterRevision"; - default: - return "Unknown"; - } - } case chip::app::Clusters::UnitTesting::Id: { switch (id) { @@ -5780,17 +5398,6 @@ char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id return "Unknown"; } } - case chip::app::Clusters::BarrierControl::Id: { - switch (id) - { - case chip::app::Clusters::BarrierControl::Commands::BarrierControlGoToPercent::Id: - return "BarrierControlGoToPercent"; - case chip::app::Clusters::BarrierControl::Commands::BarrierControlStop::Id: - return "BarrierControlStop"; - default: - return "Unknown"; - } - } case chip::app::Clusters::ServiceArea::Id: { switch (id) { @@ -6105,17 +5712,6 @@ char const * AcceptedCommandIdToText(chip::ClusterId cluster, chip::CommandId id return "Unknown"; } } - case chip::app::Clusters::ElectricalMeasurement::Id: { - switch (id) - { - case chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoCommand::Id: - return "GetProfileInfoCommand"; - case chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileCommand::Id: - return "GetMeasurementProfileCommand"; - default: - return "Unknown"; - } - } case chip::app::Clusters::UnitTesting::Id: { switch (id) { @@ -6637,17 +6233,6 @@ char const * GeneratedCommandIdToText(chip::ClusterId cluster, chip::CommandId i return "Unknown"; } } - case chip::app::Clusters::ElectricalMeasurement::Id: { - switch (id) - { - case chip::app::Clusters::ElectricalMeasurement::Commands::GetProfileInfoResponseCommand::Id: - return "GetProfileInfoResponseCommand"; - case chip::app::Clusters::ElectricalMeasurement::Commands::GetMeasurementProfileResponseCommand::Id: - return "GetMeasurementProfileResponseCommand"; - default: - return "Unknown"; - } - } case chip::app::Clusters::UnitTesting::Id: { switch (id) { diff --git a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h index 4cba7d57785f10..0f45b57afaf21c 100644 --- a/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h +++ b/zzz_generated/darwin-framework-tool/zap-generated/cluster/Commands.h @@ -40,9 +40,7 @@ | Identify | 0x0003 | | Groups | 0x0004 | | OnOff | 0x0006 | -| OnOffSwitchConfiguration | 0x0007 | | LevelControl | 0x0008 | -| BinaryInputBasic | 0x000F | | PulseWidthModulation | 0x001C | | Descriptor | 0x001D | | Binding | 0x001E | @@ -116,7 +114,6 @@ | DeviceEnergyManagementMode | 0x009F | | DoorLock | 0x0101 | | WindowCovering | 0x0102 | -| BarrierControl | 0x0103 | | ServiceArea | 0x0150 | | PumpConfigurationAndControl | 0x0200 | | Thermostat | 0x0201 | @@ -159,7 +156,6 @@ | ContentAppObserver | 0x0510 | | EcosystemInformation | 0x0750 | | CommissionerControl | 0x0751 | -| ElectricalMeasurement | 0x0B04 | | UnitTesting | 0xFFF1FC05| | FaultInjection | 0xFFF1FC06| | SampleMei | 0xFFF1FC20| From 5a9cc4cc411356c4d5cc295bbb14c54e94a721ba Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 17 Sep 2024 20:40:24 -0400 Subject: [PATCH 08/47] Fix timeout in MTRSwiftPairingTests. (#35636) 3 seconds is not enough time to do commissioning, sometimes. --- src/darwin/Framework/CHIPTests/MTRSwiftPairingTests.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/darwin/Framework/CHIPTests/MTRSwiftPairingTests.swift b/src/darwin/Framework/CHIPTests/MTRSwiftPairingTests.swift index 907b9a2761673c..6e195935368304 100644 --- a/src/darwin/Framework/CHIPTests/MTRSwiftPairingTests.swift +++ b/src/darwin/Framework/CHIPTests/MTRSwiftPairingTests.swift @@ -12,6 +12,7 @@ struct PairingConstants { static let onboardingPayload = "MT:-24J0AFN00KA0648G00" static let deviceID = 0x12344321 static let timeoutInSeconds : UInt16 = 3 + static let pairingTimeoutInSeconds : UInt16 = 60 } class MTRSwiftPairingTestControllerDelegate : NSObject, MTRDeviceControllerDelegate { @@ -96,7 +97,7 @@ class MTRSwiftPairingTests : XCTestCase { return } - wait(for: [expectation], timeout: TimeInterval(PairingConstants.timeoutInSeconds)) + wait(for: [expectation], timeout: TimeInterval(PairingConstants.pairingTimeoutInSeconds)) ResetCommissionee(MTRBaseDevice(nodeID: PairingConstants.deviceID as NSNumber, controller: controller), DispatchQueue.main, self, PairingConstants.timeoutInSeconds) From aa690858aea41fe2582c12df7a3310496e56a6f1 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Tue, 17 Sep 2024 20:49:50 -0400 Subject: [PATCH 09/47] Add a way to dynamically change whether a node identity should be advertised. (#35634) * Add a way to dynamically change whether a node identity should be advertised. In some cases, a node may need to stop or restart advertising its identity without actually tearing down the relevant CHIPDeviceController. * Add unit tests for SetShouldAdvertiseIdentity. --- src/credentials/FabricTable.cpp | 13 +++++++++ src/credentials/FabricTable.h | 14 ++++++++++ src/credentials/tests/TestFabricTable.cpp | 32 ++++++++++++++++++++++- 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/src/credentials/FabricTable.cpp b/src/credentials/FabricTable.cpp index f999cf7a4f9a9d..8ed838243df4ab 100644 --- a/src/credentials/FabricTable.cpp +++ b/src/credentials/FabricTable.cpp @@ -2164,4 +2164,17 @@ CHIP_ERROR FabricTable::SetFabricIndexForNextAddition(FabricIndex fabricIndex) return CHIP_NO_ERROR; } +CHIP_ERROR FabricTable::SetShouldAdvertiseIdentity(FabricIndex fabricIndex, AdvertiseIdentity advertiseIdentity) +{ + VerifyOrReturnError(IsValidFabricIndex(fabricIndex), CHIP_ERROR_INVALID_FABRIC_INDEX); + + FabricInfo * fabricInfo = GetMutableFabricByIndex(fabricIndex); + bool fabricIsInitialized = (fabricInfo != nullptr) && fabricInfo->IsInitialized(); + VerifyOrReturnError(fabricIsInitialized, CHIP_ERROR_INVALID_FABRIC_INDEX); + + fabricInfo->SetShouldAdvertiseIdentity(advertiseIdentity == AdvertiseIdentity::Yes); + + return CHIP_NO_ERROR; +} + } // namespace chip diff --git a/src/credentials/FabricTable.h b/src/credentials/FabricTable.h index af90d781283963..9515ffb8889c06 100644 --- a/src/credentials/FabricTable.h +++ b/src/credentials/FabricTable.h @@ -212,6 +212,8 @@ class DLL_EXPORT FabricInfo mNodeId = kUndefinedNodeId; } + void SetShouldAdvertiseIdentity(bool advertiseIdentity) { mShouldAdvertiseIdentity = advertiseIdentity; } + static constexpr size_t MetadataTLVMaxSize() { return TLV::EstimateStructOverhead(sizeof(uint16_t), kFabricLabelMaxLengthInBytes); @@ -1027,6 +1029,18 @@ class DLL_EXPORT FabricTable */ CHIP_ERROR SetFabricIndexForNextAddition(FabricIndex fabricIndex); + /** + * @brief Set the advertising behavior for the fabric identified by `fabricIndex`. + * + * It is the caller's responsibility to actually restart DNS-SD advertising + * as needed after updating this state. + * + * @param fabricIndex - Fabric Index for which to set the label + * @param advertiseIdentity - whether the identity for this fabric should be advertised. + * @retval CHIP_ERROR_INVALID_FABRIC_INDEX if fabricIndex does not refer to a fabric in the table + */ + CHIP_ERROR SetShouldAdvertiseIdentity(FabricIndex fabricIndex, AdvertiseIdentity advertiseIdentity); + private: enum class StateFlags : uint16_t { diff --git a/src/credentials/tests/TestFabricTable.cpp b/src/credentials/tests/TestFabricTable.cpp index 0d34f48bce6599..407d0863adf1d1 100644 --- a/src/credentials/tests/TestFabricTable.cpp +++ b/src/credentials/tests/TestFabricTable.cpp @@ -706,6 +706,7 @@ TEST_F(TestFabricTable, TestBasicAddNocUpdateNocFlow) { EXPECT_EQ(iterFabricInfo.GetNodeId(), nodeId); EXPECT_EQ(iterFabricInfo.GetFabricId(), fabricId); + EXPECT_TRUE(iterFabricInfo.ShouldAdvertiseIdentity()); saw1 = true; } } @@ -817,12 +818,14 @@ TEST_F(TestFabricTable, TestBasicAddNocUpdateNocFlow) { EXPECT_EQ(iterFabricInfo.GetNodeId(), 55u); EXPECT_EQ(iterFabricInfo.GetFabricId(), 11u); + EXPECT_TRUE(iterFabricInfo.ShouldAdvertiseIdentity()); saw1 = true; } if (iterFabricInfo.GetFabricIndex() == 2) { EXPECT_EQ(iterFabricInfo.GetNodeId(), 999u); EXPECT_EQ(iterFabricInfo.GetFabricId(), 44u); + EXPECT_TRUE(iterFabricInfo.ShouldAdvertiseIdentity()); saw2 = true; } } @@ -1104,7 +1107,9 @@ TEST_F(TestFabricTable, TestAddMultipleSameRootDifferentFabricId) EXPECT_EQ(fabricTable.FabricCount(), 0); EXPECT_EQ(fabricTable.AddNewPendingTrustedRootCert(rcac), CHIP_NO_ERROR); FabricIndex newFabricIndex = kUndefinedFabricIndex; - EXPECT_EQ(fabricTable.AddNewPendingFabricWithOperationalKeystore(noc, icac, kVendorId, &newFabricIndex), CHIP_NO_ERROR); + EXPECT_EQ(fabricTable.AddNewPendingFabricWithOperationalKeystore(noc, icac, kVendorId, &newFabricIndex, + FabricTable::AdvertiseIdentity::No), + CHIP_NO_ERROR); EXPECT_EQ(fabricTable.FabricCount(), 1); EXPECT_EQ(newFabricIndex, 1); @@ -1118,6 +1123,23 @@ TEST_F(TestFabricTable, TestAddMultipleSameRootDifferentFabricId) EXPECT_EQ(fabricInfo->GetFabricId(), 1111u); EXPECT_EQ(fabricInfo->GetVendorId(), kVendorId); EXPECT_EQ(fabricInfo->GetFabricLabel().size(), 0u); + EXPECT_FALSE(fabricInfo->ShouldAdvertiseIdentity()); + + EXPECT_EQ(fabricTable.SetShouldAdvertiseIdentity(newFabricIndex, FabricTable::AdvertiseIdentity::Yes), CHIP_NO_ERROR); + EXPECT_TRUE(fabricInfo->ShouldAdvertiseIdentity()); + + // Check that for indices we don't have a fabric for, SetShouldAdvertiseIdentity fails. + EXPECT_EQ(fabricTable.SetShouldAdvertiseIdentity(kUndefinedFabricIndex, FabricTable::AdvertiseIdentity::No), + CHIP_ERROR_INVALID_FABRIC_INDEX); + EXPECT_EQ(fabricTable.SetShouldAdvertiseIdentity(kUndefinedFabricIndex, FabricTable::AdvertiseIdentity::Yes), + CHIP_ERROR_INVALID_FABRIC_INDEX); + EXPECT_EQ(fabricTable.SetShouldAdvertiseIdentity(2, FabricTable::AdvertiseIdentity::Yes), CHIP_ERROR_INVALID_FABRIC_INDEX); + EXPECT_EQ(fabricTable.SetShouldAdvertiseIdentity(2, FabricTable::AdvertiseIdentity::No), CHIP_ERROR_INVALID_FABRIC_INDEX); + + EXPECT_TRUE(fabricInfo->ShouldAdvertiseIdentity()); + + EXPECT_EQ(fabricTable.SetShouldAdvertiseIdentity(newFabricIndex, FabricTable::AdvertiseIdentity::No), CHIP_NO_ERROR); + EXPECT_FALSE(fabricInfo->ShouldAdvertiseIdentity()); } size_t numStorageKeysAfterFirstAdd = storage.GetNumKeys(); EXPECT_EQ(numStorageKeysAfterFirstAdd, 7u); // Metadata, index, 3 certs, 1 opkey, last known good time @@ -1155,6 +1177,14 @@ TEST_F(TestFabricTable, TestAddMultipleSameRootDifferentFabricId) EXPECT_EQ(fabricInfo->GetFabricId(), 2222u); EXPECT_EQ(fabricInfo->GetVendorId(), kVendorId); EXPECT_EQ(fabricInfo->GetFabricLabel().size(), 0u); + + EXPECT_TRUE(fabricInfo->ShouldAdvertiseIdentity()); + + EXPECT_EQ(fabricTable.SetShouldAdvertiseIdentity(newFabricIndex, FabricTable::AdvertiseIdentity::No), CHIP_NO_ERROR); + EXPECT_FALSE(fabricInfo->ShouldAdvertiseIdentity()); + + EXPECT_EQ(fabricTable.SetShouldAdvertiseIdentity(newFabricIndex, FabricTable::AdvertiseIdentity::Yes), CHIP_NO_ERROR); + EXPECT_TRUE(fabricInfo->ShouldAdvertiseIdentity()); } size_t numStorageKeysAfterSecondAdd = storage.GetNumKeys(); EXPECT_EQ(numStorageKeysAfterSecondAdd, (numStorageKeysAfterFirstAdd + 5)); // Add 3 certs, 1 metadata, 1 opkey From 4e152833b83f2424c32adf5238bd61eeaedc9df1 Mon Sep 17 00:00:00 2001 From: Kamil Kasperczyk <66371704+kkasperczyk-no@users.noreply.github.com> Date: Wed, 18 Sep 2024 08:30:33 +0200 Subject: [PATCH 10/47] [lit] Added support for ICD DSLS in nrfconnect platform (#35618) Added configuration option allowing to enable ICD DSLS for nrfconnect platform and integrated this functionality in the lit example. --- config/nrfconnect/chip-module/CMakeLists.txt | 1 + config/zephyr/Kconfig | 13 ++++++-- examples/lit-icd-app/nrfconnect/README.md | 5 +++ .../lit-icd-app/nrfconnect/main/AppTask.cpp | 31 +++++++++++++++++++ .../nrfconnect/main/include/AppConfig.h | 2 ++ .../nrfconnect/main/include/AppTask.h | 3 ++ examples/lit-icd-app/nrfconnect/prj.conf | 2 ++ .../lit-icd-app/nrfconnect/prj_release.conf | 2 ++ 8 files changed, 56 insertions(+), 3 deletions(-) diff --git a/config/nrfconnect/chip-module/CMakeLists.txt b/config/nrfconnect/chip-module/CMakeLists.txt index 98fee746485cc3..3896ed6be7d9ad 100644 --- a/config/nrfconnect/chip-module/CMakeLists.txt +++ b/config/nrfconnect/chip-module/CMakeLists.txt @@ -155,6 +155,7 @@ if (CONFIG_CHIP_ENABLE_ICD_SUPPORT) matter_add_gn_arg_bool ("chip_enable_icd_lit" CONFIG_CHIP_ICD_LIT_SUPPORT) matter_add_gn_arg_bool ("chip_enable_icd_checkin" CONFIG_CHIP_ICD_CHECK_IN_SUPPORT) matter_add_gn_arg_bool ("chip_enable_icd_user_active_mode_trigger" CONFIG_CHIP_ICD_UAT_SUPPORT) + matter_add_gn_arg_bool ("chip_enable_icd_dsls" CONFIG_CHIP_ICD_DSLS_SUPPORT) matter_add_gn_arg_bool ("icd_enforce_sit_slow_poll_limit" TRUE) endif() diff --git a/config/zephyr/Kconfig b/config/zephyr/Kconfig index 06b1d6fa5f79ad..27598c7095c9aa 100644 --- a/config/zephyr/Kconfig +++ b/config/zephyr/Kconfig @@ -398,7 +398,7 @@ config CHIP_ICD_ACTIVE_MODE_THRESHOLD For LIT devices it cannot be set to a value smaller than 5000 ms. config CHIP_ICD_LIT_SUPPORT - bool "Intermittenly Connected Device Long Idle Time support" + bool "Intermittently Connected Device Long Idle Time support" imply CHIP_ICD_CHECK_IN_SUPPORT imply CHIP_ICD_UAT_SUPPORT help @@ -406,17 +406,24 @@ config CHIP_ICD_LIT_SUPPORT It also implies the ICD Check-In and UAT features support that are mandatory for LIT device. config CHIP_ICD_CHECK_IN_SUPPORT - bool "Intermittenly Connected Device Check-In protocol support" + bool "Intermittently Connected Device Check-In protocol support" help Enables the Check-In protocol support in Matter. It allows an ICD device to notify the registered ICD clients that it is available for communication. config CHIP_ICD_UAT_SUPPORT - bool "Intermittenly Connected Device User Active Mode Trigger support" + bool "Intermittently Connected Device User Active Mode Trigger support" help Enables the User Active Mode Trigger (UAT) support in Matter. It allows the User to use application specific means (e.g. button press) to trigger an ICD device to enter the active mode and become responsive. +config CHIP_ICD_DSLS_SUPPORT + bool "Intermittenttly Connected Device Dynamic SIT LIT support" + depends on CHIP_ICD_LIT_SUPPORT + help + Enables the Dynamic SIT LIT support in Matter. It allows the application to dynamically switch between + SIT and LIT modes, as long as the requirements for these modes are met (e.g. device has at least one active ICD client). + config CHIP_ICD_CLIENTS_PER_FABRIC int "Intermittently Connected Device number of clients per fabric" default 2 diff --git a/examples/lit-icd-app/nrfconnect/README.md b/examples/lit-icd-app/nrfconnect/README.md index 1ff58274962fd9..ff0f6b6699cdf8 100644 --- a/examples/lit-icd-app/nrfconnect/README.md +++ b/examples/lit-icd-app/nrfconnect/README.md @@ -167,6 +167,11 @@ duration of the effect. of the device. Releasing the button within the 3-second window cancels the factory reset procedure. +**Button 2** Represents the Dynamic SIT LIT Support feature from the +Intermittently Connected Devices Management cluster. Pressing it requests +putting the ICD device in the SIT mode. Pressing the button again withdraws the +previous request. + **Button 3** Represents the User Active Mode Trigger feature from the Intermittently Connected Devices Management cluster. Pressing it puts the ICD device in the active mode and makes it responsive. diff --git a/examples/lit-icd-app/nrfconnect/main/AppTask.cpp b/examples/lit-icd-app/nrfconnect/main/AppTask.cpp index 336024fe289ea3..2fab2d91f83bb8 100644 --- a/examples/lit-icd-app/nrfconnect/main/AppTask.cpp +++ b/examples/lit-icd-app/nrfconnect/main/AppTask.cpp @@ -86,6 +86,10 @@ bool sHaveBLEConnections = false; #ifdef CONFIG_CHIP_CRYPTO_PSA chip::Crypto::PSAOperationalKeystore sPSAOperationalKeystore{}; #endif + +#ifdef CONFIG_CHIP_ICD_DSLS_SUPPORT +bool sIsSitModeRequested = false; +#endif } // namespace namespace LedConsts { @@ -285,6 +289,16 @@ void AppTask::ButtonEventHandler(uint32_t buttonState, uint32_t hasChanged) PostEvent(button_event); } +#ifdef CONFIG_CHIP_ICD_DSLS_SUPPORT + if (ICD_DSLS_BUTTON_MASK & buttonState & hasChanged) + { + button_event.ButtonEvent.PinNo = ICD_DSLS_BUTTON; + button_event.ButtonEvent.Action = static_cast(AppEventType::ButtonPushed); + button_event.Handler = IcdDslsEventHandler; + PostEvent(button_event); + } +#endif + if (ICD_UAT_BUTTON_MASK & hasChanged) { button_event.ButtonEvent.PinNo = ICD_UAT_BUTTON; @@ -294,6 +308,23 @@ void AppTask::ButtonEventHandler(uint32_t buttonState, uint32_t hasChanged) } } +#ifdef CONFIG_CHIP_ICD_DSLS_SUPPORT +void AppTask::IcdDslsEventHandler(const AppEvent &) +{ + if (sIsSitModeRequested) + { + PlatformMgr().ScheduleWork([](intptr_t arg) { chip::app::ICDNotifier::GetInstance().NotifySITModeRequestWithdrawal(); }, 0); + sIsSitModeRequested = false; + } + else + { + PlatformMgr().ScheduleWork([](intptr_t arg) { chip::app::ICDNotifier::GetInstance().NotifySITModeRequestNotification(); }, + 0); + sIsSitModeRequested = true; + } +} +#endif + void AppTask::IcdUatEventHandler(const AppEvent &) { // Temporarily claim network activity, until we implement a "user trigger" reason for ICD wakeups. diff --git a/examples/lit-icd-app/nrfconnect/main/include/AppConfig.h b/examples/lit-icd-app/nrfconnect/main/include/AppConfig.h index 26f63f5ec1fa06..7bde71fff0c9b1 100644 --- a/examples/lit-icd-app/nrfconnect/main/include/AppConfig.h +++ b/examples/lit-icd-app/nrfconnect/main/include/AppConfig.h @@ -23,6 +23,8 @@ #define FUNCTION_BUTTON DK_BTN1 #define FUNCTION_BUTTON_MASK DK_BTN1_MSK +#define ICD_DSLS_BUTTON DK_BTN2 +#define ICD_DSLS_BUTTON_MASK DK_BTN2_MSK #define ICD_UAT_BUTTON DK_BTN3 #define ICD_UAT_BUTTON_MASK DK_BTN3_MSK #define BLE_ADVERTISEMENT_START_BUTTON DK_BTN4 diff --git a/examples/lit-icd-app/nrfconnect/main/include/AppTask.h b/examples/lit-icd-app/nrfconnect/main/include/AppTask.h index f1513b2d1e75cb..0b9dc7cd2311a6 100644 --- a/examples/lit-icd-app/nrfconnect/main/include/AppTask.h +++ b/examples/lit-icd-app/nrfconnect/main/include/AppTask.h @@ -56,6 +56,9 @@ class AppTask static void FunctionTimerEventHandler(const AppEvent & event); static void FunctionHandler(const AppEvent & event); static void StartBLEAdvertisementHandler(const AppEvent & event); +#ifdef CONFIG_CHIP_ICD_DSLS_SUPPORT + static void IcdDslsEventHandler(const AppEvent & event); +#endif static void IcdUatEventHandler(const AppEvent & event); static void UpdateLedStateEventHandler(const AppEvent & event); diff --git a/examples/lit-icd-app/nrfconnect/prj.conf b/examples/lit-icd-app/nrfconnect/prj.conf index a21c89fd5c0009..77e944e442e15f 100644 --- a/examples/lit-icd-app/nrfconnect/prj.conf +++ b/examples/lit-icd-app/nrfconnect/prj.conf @@ -51,3 +51,5 @@ CONFIG_CHIP_FACTORY_DATA_BUILD=y # Enable LIT ICD configuration CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_ICD_LIT_SUPPORT=y +CONFIG_CHIP_ICD_DSLS_SUPPORT=y +CONFIG_CHIP_ICD_SIT_SLOW_POLL_LIMIT=5000 diff --git a/examples/lit-icd-app/nrfconnect/prj_release.conf b/examples/lit-icd-app/nrfconnect/prj_release.conf index 9ae438428f602d..7d4aad434b3c1a 100644 --- a/examples/lit-icd-app/nrfconnect/prj_release.conf +++ b/examples/lit-icd-app/nrfconnect/prj_release.conf @@ -65,3 +65,5 @@ CONFIG_CHIP_FACTORY_DATA_BUILD=y # Enable LIT ICD configuration CONFIG_CHIP_ENABLE_ICD_SUPPORT=y CONFIG_CHIP_ICD_LIT_SUPPORT=y +CONFIG_CHIP_ICD_DSLS_SUPPORT=y +CONFIG_CHIP_ICD_SIT_SLOW_POLL_LIMIT=5000 From e6a6425c331678c532c813e9d9fb4d1bfeaaab71 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Wed, 18 Sep 2024 00:45:36 -0700 Subject: [PATCH 11/47] [Fabric-Admin] Update the Fabric Sync guide to explain the confusion (#35638) * [Fabric-Admin] Update the Fabric Sync guide to explain the confusion * Add Fabric Sync Setup process description * Restyled by prettier-markdown --------- Co-authored-by: Restyled.io --- docs/guides/fabric_synchronization_guide.md | 9 +++++++++ .../commands/interactive/InteractiveCommands.cpp | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/guides/fabric_synchronization_guide.md b/docs/guides/fabric_synchronization_guide.md index e5d47dda8f9563..f9146ac9f2d6d7 100644 --- a/docs/guides/fabric_synchronization_guide.md +++ b/docs/guides/fabric_synchronization_guide.md @@ -96,6 +96,10 @@ Run the Fabric Synchronization script: ### Fabric Sync Setup +Fabric Sync Setup is the process of enabling two ecosystems that support the +Fabric Synchronization feature to commission each other's Fabric Bridge nodes +into their respective private fabrics. + In Ecosystem 1 Fabric-Admin console: Pair the local bridge of Ecosystem 1 with node ID 1: @@ -118,6 +122,11 @@ of Ecosystem 1 has successfully paired with Ecosystem 2 on Endpoint 2: >>> A new device is added on Endpoint 2. ``` +Note: We only need to add the local bridge to the ecosystem to trigger the +Fabric Sync Setup process. In the example above, the Fabric Sync Setup process +is initiated by the command 'add-bridge' from Ecosystem 1. Adding the local +bridge on the other side is optional. + ### Pair Light Example to Ecosystem 2 Since Fabric-Bridge also functions as a Matter server, running it alongside the diff --git a/examples/fabric-admin/commands/interactive/InteractiveCommands.cpp b/examples/fabric-admin/commands/interactive/InteractiveCommands.cpp index 47947bb5a86151..0209a783739b74 100644 --- a/examples/fabric-admin/commands/interactive/InteractiveCommands.cpp +++ b/examples/fabric-admin/commands/interactive/InteractiveCommands.cpp @@ -43,7 +43,7 @@ constexpr char kInteractiveModeHistoryFileName[] = "chip_tool_history"; constexpr char kInteractiveModeStopCommand[] = "quit()"; #if defined(PW_RPC_ENABLED) -constexpr uint16_t kRetryIntervalS = 5; +constexpr uint16_t kRetryIntervalS = 3; #endif // File pointer for the log file From 1d6b0a5815dbaa2a8c46bd5e27648b661b746e8c Mon Sep 17 00:00:00 2001 From: Martin Girardot <165289184+Martin-NXP@users.noreply.github.com> Date: Wed, 18 Sep 2024 12:20:50 +0200 Subject: [PATCH 12/47] [NXP][rw61x] Diagnostic log, factory data storage, ICD, fixes (#35576) * [NXP][cli][common] Enabled lwip and ephemeral key CLI addons in Matter shell (cherry picked from commit 01477f70a674691aa3f8957df09955ad94db4372) * [NXP][examples][common]Add diagnostic logs support for thermostat app Signed-off-by: Martin Girardot (cherry picked from commit 278973079fee7357c0d60b2cf2d10730c82e4497) * [NXP][examples][laundry-washer] Fix Matter 1.3 certifiction TC-TCTL-3.3 case that SupportedTemperatureLevel should not be empty Signed-off-by: Chin-Ran Lo (cherry picked from commit c46f6ceb2bc2c6708ba62663ab53a86215691052) * [NXP][examples][common] Fix laundry-washer app Identify cluster issue on endepoint 0 Signed-off-by: Chin-Ran Lo (cherry picked from commit 3f2d5f7cafce98761393f1db17f46c9590bb600a) * [NXP][examples][common] Add laundry wahser mode file Signed-off-by: Martin Girardot (cherry picked from commit a73da0d7e757b1b908470a3136761de58b9de08a) * [NXP][examples][rw61x] update laundry washer mode file path, add icd support Signed-off-by: Martin Girardot (cherry picked from commit 1f2b75325595951d389403d82180dd74152a85dc) * [NXP][examples][rw61x] Enable Disgnostic log for thermostat app Signed-off-by: Martin Girardot (cherry picked from commit c10f479ab9bff6b16a595448c3c03ced17f4d725) * [NXP][examples][rw61x] Update thermostat and laundry washer example for new factory data protection option Signed-off-by: Martin Girardot * Restyled by clang-format * Restyled by gn * [NXP] fix PR comments: spelling, delete identify on endpoint 0 Signed-off-by: Martin Girardot --------- Signed-off-by: Martin Girardot Co-authored-by: Marius Preda Co-authored-by: Chin-Ran Lo Co-authored-by: Restyled.io --- .../nxp/common/main/AppTask.cpp | 9 +- .../nxp/common/main/DeviceCallbacks.cpp | 8 -- .../nxp/common/main/laundry-washer-mode.cpp | 104 ++++++++++++++++++ .../laundry-washer-app/nxp/rt/rw61x/BUILD.gn | 11 +- .../laundry-washer-app/nxp/rt/rw61x/args.gni | 6 + .../nxp/common/diagnostic_logs/BUILD.gn | 24 ---- .../common/matter_cli/source/AppCLIBase.cpp | 12 ++ .../nxp/common/main/ZclCallbacks.cpp | 17 +++ examples/thermostat/nxp/rt/rw61x/BUILD.gn | 29 ++++- 9 files changed, 181 insertions(+), 39 deletions(-) create mode 100644 examples/laundry-washer-app/nxp/common/main/laundry-washer-mode.cpp delete mode 100644 examples/platform/nxp/common/diagnostic_logs/BUILD.gn diff --git a/examples/laundry-washer-app/nxp/common/main/AppTask.cpp b/examples/laundry-washer-app/nxp/common/main/AppTask.cpp index fb37f4f13a78f5..5d82dcf92ef7b3 100644 --- a/examples/laundry-washer-app/nxp/common/main/AppTask.cpp +++ b/examples/laundry-washer-app/nxp/common/main/AppTask.cpp @@ -37,7 +37,14 @@ using namespace chip::Shell; using namespace chip; using namespace chip::app::Clusters; +/* + * Enable temperature level delegate of temperature control cluster + */ app::Clusters::TemperatureControl::AppSupportedTemperatureLevelsDelegate sAppSupportedTemperatureLevelsDelegate; +void emberAfTemperatureControlClusterInitCallback(EndpointId endpoint) +{ + TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); +} #ifdef ENABLE_CHIP_SHELL const static std::map map_cmd_errstate{ @@ -119,8 +126,6 @@ void LaundryWasherApp::AppTask::PreInitMatterStack() void LaundryWasherApp::AppTask::PostInitMatterStack() { chip::app::InteractionModelEngine::GetInstance()->RegisterReadHandlerAppCallback(&chip::NXP::App::GetICDUtil()); - - app::Clusters::TemperatureControl::SetInstance(&sAppSupportedTemperatureLevelsDelegate); } void LaundryWasherApp::AppTask::AppMatter_RegisterCustomCliCommands() diff --git a/examples/laundry-washer-app/nxp/common/main/DeviceCallbacks.cpp b/examples/laundry-washer-app/nxp/common/main/DeviceCallbacks.cpp index 0d20cf015a7954..8d5170c1e890ed 100644 --- a/examples/laundry-washer-app/nxp/common/main/DeviceCallbacks.cpp +++ b/examples/laundry-washer-app/nxp/common/main/DeviceCallbacks.cpp @@ -58,14 +58,6 @@ void OnTriggerEffect(::Identify * identify) } } -Identify gIdentify0 = { - chip::EndpointId{ 1 }, - [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); }, - [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStop"); }, - chip::app::Clusters::Identify::IdentifyTypeEnum::kNone, - OnTriggerEffect, -}; - Identify gIdentify1 = { chip::EndpointId{ 1 }, [](Identify *) { ChipLogProgress(Zcl, "onIdentifyStart"); }, diff --git a/examples/laundry-washer-app/nxp/common/main/laundry-washer-mode.cpp b/examples/laundry-washer-app/nxp/common/main/laundry-washer-mode.cpp new file mode 100644 index 00000000000000..2dedf4c1f8c69b --- /dev/null +++ b/examples/laundry-washer-app/nxp/common/main/laundry-washer-mode.cpp @@ -0,0 +1,104 @@ +/* + * + * Copyright (c) 2023 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include + +using namespace chip::app::Clusters; +using namespace chip::app::Clusters::LaundryWasherMode; +using chip::Protocols::InteractionModel::Status; +template +using List = chip::app::DataModel::List; +using ModeTagStructType = chip::app::Clusters::detail::Structs::ModeTagStruct::Type; + +static LaundryWasherModeDelegate * gLaundryWasherModeDelegate = nullptr; +static ModeBase::Instance * gLaundryWasherModeInstance = nullptr; + +CHIP_ERROR LaundryWasherModeDelegate::Init() +{ + return CHIP_NO_ERROR; +} + +void LaundryWasherModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type & response) +{ + response.status = to_underlying(ModeBase::StatusCode::kSuccess); +} + +CHIP_ERROR LaundryWasherModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::MutableCharSpan & label) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + return chip::CopyCharSpanToMutableCharSpan(kModeOptions[modeIndex].label, label); +} + +CHIP_ERROR LaundryWasherModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + value = kModeOptions[modeIndex].mode; + return CHIP_NO_ERROR; +} + +CHIP_ERROR LaundryWasherModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, List & tags) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + + if (tags.size() < kModeOptions[modeIndex].modeTags.size()) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + std::copy(kModeOptions[modeIndex].modeTags.begin(), kModeOptions[modeIndex].modeTags.end(), tags.begin()); + tags.reduce_size(kModeOptions[modeIndex].modeTags.size()); + + return CHIP_NO_ERROR; +} + +ModeBase::Instance * LaundryWasherMode::Instance() +{ + return gLaundryWasherModeInstance; +} + +void LaundryWasherMode::Shutdown() +{ + if (gLaundryWasherModeInstance != nullptr) + { + delete gLaundryWasherModeInstance; + gLaundryWasherModeInstance = nullptr; + } + if (gLaundryWasherModeDelegate != nullptr) + { + delete gLaundryWasherModeDelegate; + gLaundryWasherModeDelegate = nullptr; + } +} + +void emberAfLaundryWasherModeClusterInitCallback(chip::EndpointId endpointId) +{ + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. + VerifyOrDie(gLaundryWasherModeDelegate == nullptr && gLaundryWasherModeInstance == nullptr); + gLaundryWasherModeDelegate = new LaundryWasherMode::LaundryWasherModeDelegate; + gLaundryWasherModeInstance = new ModeBase::Instance(gLaundryWasherModeDelegate, 0x1, LaundryWasherMode::Id, 0); + gLaundryWasherModeInstance->Init(); +} diff --git a/examples/laundry-washer-app/nxp/rt/rw61x/BUILD.gn b/examples/laundry-washer-app/nxp/rt/rw61x/BUILD.gn index f487ff415f1330..580a3ad556702b 100644 --- a/examples/laundry-washer-app/nxp/rt/rw61x/BUILD.gn +++ b/examples/laundry-washer-app/nxp/rt/rw61x/BUILD.gn @@ -66,7 +66,8 @@ rt_sdk("sdk") { defines = [] # To be moved, temporary mbedtls config fix to build app with factory data - if (chip_enable_secure_dac_private_key_storage == 1) { + if (chip_enable_secure_dac_private_key_storage || + chip_enable_secure_whole_factory_data) { defines += [ "MBEDTLS_NIST_KW_C", "MBEDTLS_PSA_CRYPTO_CLIENT", @@ -150,8 +151,12 @@ rt_executable("laundry-washer") { "../../common/main/main.cpp", ] - if (chip_enable_secure_dac_private_key_storage == 1) { + if (chip_enable_secure_dac_private_key_storage || + chip_enable_secure_whole_factory_data) { sources += [ "${chip_root}/examples/platform/nxp/${nxp_platform}/factory_data/source/AppFactoryDataExample.cpp" ] + if (chip_enable_secure_whole_factory_data) { + defines += [ "ENABLE_SECURE_WHOLE_FACTORY_DATA" ] + } } else { sources += [ "${common_example_dir}/factory_data/source/AppFactoryDataDefaultImpl.cpp", @@ -186,10 +191,10 @@ rt_executable("laundry-washer") { sources += [ "${chip_root}/examples/all-clusters-app/all-clusters-common/src/bridged-actions-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/laundry-washer-controls-delegate-impl.cpp", - "${chip_root}/examples/all-clusters-app/all-clusters-common/src/laundry-washer-mode.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/smco-stub.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-modes-manager.cpp", "${chip_root}/examples/all-clusters-app/all-clusters-common/src/static-supported-temperature-levels.cpp", + "../../common/main/laundry-washer-mode.cpp", "../../common/main/operational-state-delegate-impl.cpp", ] diff --git a/examples/laundry-washer-app/nxp/rt/rw61x/args.gni b/examples/laundry-washer-app/nxp/rt/rw61x/args.gni index c2d91a5db7bae7..d65714c9287ce5 100644 --- a/examples/laundry-washer-app/nxp/rt/rw61x/args.gni +++ b/examples/laundry-washer-app/nxp/rt/rw61x/args.gni @@ -17,3 +17,9 @@ import("//build_overrides/chip.gni") # SDK target definitions nxp_sdk_target = get_label_info(":sdk", "label_no_toolchain") nxp_sdk_driver_target = get_label_info(":sdk_driver", "label_no_toolchain") + +# ICDM +chip_enable_icd_server = true +chip_persist_subscriptions = true +chip_subscription_timeout_resumption = true +chip_enable_icd_checkin = true diff --git a/examples/platform/nxp/common/diagnostic_logs/BUILD.gn b/examples/platform/nxp/common/diagnostic_logs/BUILD.gn deleted file mode 100644 index 04d864753a6633..00000000000000 --- a/examples/platform/nxp/common/diagnostic_logs/BUILD.gn +++ /dev/null @@ -1,24 +0,0 @@ -# Copyright (c) 2024 Project CHIP Authors -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -import("//build_overrides/chip.gni") - -source_set("nxp_diagnostic_logs") { - sources = [ - "DiagnosticLogsProviderDelegateImpl.cpp", - "DiagnosticLogsProviderDelegateImpl.h", - ] - - include_dirs = [ "${chip_root}/src" ] -} diff --git a/examples/platform/nxp/common/matter_cli/source/AppCLIBase.cpp b/examples/platform/nxp/common/matter_cli/source/AppCLIBase.cpp index 9bd53ff21cbd4a..f6256040dca767 100644 --- a/examples/platform/nxp/common/matter_cli/source/AppCLIBase.cpp +++ b/examples/platform/nxp/common/matter_cli/source/AppCLIBase.cpp @@ -24,6 +24,15 @@ #include #include +#if (CHIP_DEVICE_CONFIG_ENABLE_WPA && CHIP_ENABLE_OPENTHREAD) + +#include + +extern "C" { +#include "addons_cli.h" +} +#endif + #define MATTER_CLI_LOG(message) (chip::Shell::streamer_printf(chip::Shell::streamer_get(), message)) static CHIP_ERROR commissioningManager(int argc, char * argv[]) @@ -80,6 +89,9 @@ void chip::NXP::App::AppCLIBase::RegisterDefaultCommands(void) /* Register common shell commands */ cmd_misc_init(); cmd_otcli_init(); +#if (CHIP_DEVICE_CONFIG_ENABLE_WPA && CHIP_ENABLE_OPENTHREAD) + otAppCliAddonsInit(chip::DeviceLayer::ThreadStackMgrImpl().OTInstance()); +#endif #if CHIP_SHELL_ENABLE_CMD_SERVER cmd_app_server_init(); #endif /* CHIP_SHELL_ENABLE_CMD_SERVER */ diff --git a/examples/thermostat/nxp/common/main/ZclCallbacks.cpp b/examples/thermostat/nxp/common/main/ZclCallbacks.cpp index d4be6f1eb89a8c..645c9fd86bbc6e 100644 --- a/examples/thermostat/nxp/common/main/ZclCallbacks.cpp +++ b/examples/thermostat/nxp/common/main/ZclCallbacks.cpp @@ -26,8 +26,17 @@ #include #include +#if CONFIG_DIAG_LOGS_DEMO +#include +#include +#endif + using namespace ::chip; +#if CONFIG_DIAG_LOGS_DEMO +using namespace ::chip::app::Clusters::DiagnosticLogs; +#endif + void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & path, uint8_t type, uint16_t size, uint8_t * value) { chip::DeviceManager::CHIPDeviceManagerCallbacks * cb = @@ -38,3 +47,11 @@ void MatterPostAttributeChangeCallback(const chip::app::ConcreteAttributePath & cb->PostAttributeChangeCallback(path.mEndpointId, path.mClusterId, path.mAttributeId, type, size, value); } } + +#if CONFIG_DIAG_LOGS_DEMO +void emberAfDiagnosticLogsClusterInitCallback(chip::EndpointId endpoint) +{ + auto & logProvider = LogProvider::GetInstance(); + DiagnosticLogsServer::Instance().SetDiagnosticLogsProviderDelegate(endpoint, &logProvider); +} +#endif diff --git a/examples/thermostat/nxp/rt/rw61x/BUILD.gn b/examples/thermostat/nxp/rt/rw61x/BUILD.gn index 711ebf0d655f20..30af1be0e99a38 100644 --- a/examples/thermostat/nxp/rt/rw61x/BUILD.gn +++ b/examples/thermostat/nxp/rt/rw61x/BUILD.gn @@ -47,6 +47,8 @@ declare_args() { # Setup discriminator as argument setup_discriminator = 3840 + + chip_with_diag_logs_demo = true } example_platform_dir = @@ -66,7 +68,8 @@ rt_sdk("sdk") { defines = [] # To be moved, temporary mbedtls config fix to build app with factory data - if (chip_enable_secure_dac_private_key_storage == 1) { + if (chip_enable_secure_dac_private_key_storage || + chip_enable_secure_whole_factory_data) { defines += [ "MBEDTLS_NIST_KW_C", "MBEDTLS_PSA_CRYPTO_CLIENT", @@ -127,6 +130,13 @@ rt_executable("thermostat") { defines += [ "CONFIG_NET_L2_OPENTHREAD=1" ] } + if (chip_with_diag_logs_demo) { + defines += [ + "CONFIG_DIAG_LOGS_DEMO=1", + "CHIP_DEVICE_CONFIG_MAX_DIAG_LOG_SIZE=1024", + ] + } + include_dirs = [ "../../common/main/include", "../../common/main", @@ -146,8 +156,23 @@ rt_executable("thermostat") { "../../common/main/main.cpp", ] - if (chip_enable_secure_dac_private_key_storage == 1) { + if (chip_with_diag_logs_demo) { + include_dirs += [ + "${common_example_dir}/diagnostic_logs/include", + "${chip_root}", + ] + sources += [ + "${common_example_dir}/diagnostic_logs/source/DiagnosticLogsDemo.cpp", + "${common_example_dir}/diagnostic_logs/source/DiagnosticLogsProviderDelegateImpl.cpp", + ] + } + + if (chip_enable_secure_dac_private_key_storage || + chip_enable_secure_whole_factory_data) { sources += [ "${chip_root}/examples/platform/nxp/${nxp_platform}/factory_data/source/AppFactoryDataExample.cpp" ] + if (chip_enable_secure_whole_factory_data) { + defines += [ "ENABLE_SECURE_WHOLE_FACTORY_DATA" ] + } } else { sources += [ "${common_example_dir}/factory_data/source/AppFactoryDataDefaultImpl.cpp", From 2ac9bed0a73a041637e01aecd6a48e73c97f28b7 Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Wed, 18 Sep 2024 04:11:14 -0700 Subject: [PATCH 13/47] [Fabric-Admin] Fix compile errors when RPC is disabled (#35639) * Fix compile error when RPC is disabled * Restyled by whitespace * Restyled by clang-format --------- Co-authored-by: Restyled.io --- .../device_manager/DeviceSubscription.cpp | 25 +++++++++++++---- .../device_manager/DeviceSubscription.h | 9 +++++- .../DeviceSubscriptionManager.cpp | 3 ++ .../device_manager/DeviceSynchronization.cpp | 28 +++++++++++++++---- .../device_manager/DeviceSynchronization.h | 7 ++++- 5 files changed, 59 insertions(+), 13 deletions(-) diff --git a/examples/fabric-admin/device_manager/DeviceSubscription.cpp b/examples/fabric-admin/device_manager/DeviceSubscription.cpp index dddb4f9f758291..e83eda282c476b 100644 --- a/examples/fabric-admin/device_manager/DeviceSubscription.cpp +++ b/examples/fabric-admin/device_manager/DeviceSubscription.cpp @@ -17,7 +17,10 @@ */ #include "DeviceSubscription.h" + +#if defined(PW_RPC_ENABLED) #include "rpc/RpcClient.h" +#endif #include #include @@ -61,11 +64,14 @@ void DeviceSubscription::OnAttributeData(const ConcreteDataAttributePath & path, CHIP_ERROR err = data->Get(windowStatus); VerifyOrReturn(err == CHIP_NO_ERROR, ChipLogError(NotSpecified, "Failed to read WindowStatus")); VerifyOrReturn(windowStatus != Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum::kUnknownEnumValue); +#if defined(PW_RPC_ENABLED) mCurrentAdministratorCommissioningAttributes.window_status = static_cast(windowStatus); - mChangeDetected = true; +#endif + mChangeDetected = true; break; } case Clusters::AdministratorCommissioning::Attributes::AdminFabricIndex::Id: { +#if defined(PW_RPC_ENABLED) FabricIndex fabricIndex; CHIP_ERROR err = data->Get(fabricIndex); mCurrentAdministratorCommissioningAttributes.has_opener_fabric_index = err == CHIP_NO_ERROR; @@ -73,10 +79,12 @@ void DeviceSubscription::OnAttributeData(const ConcreteDataAttributePath & path, { mCurrentAdministratorCommissioningAttributes.opener_fabric_index = static_cast(fabricIndex); } +#endif mChangeDetected = true; break; } case Clusters::AdministratorCommissioning::Attributes::AdminVendorId::Id: { +#if defined(PW_RPC_ENABLED) chip::VendorId vendorId; CHIP_ERROR err = data->Get(vendorId); mCurrentAdministratorCommissioningAttributes.has_opener_vendor_id = err == CHIP_NO_ERROR; @@ -84,6 +92,7 @@ void DeviceSubscription::OnAttributeData(const ConcreteDataAttributePath & path, { mCurrentAdministratorCommissioningAttributes.opener_vendor_id = static_cast(vendorId); } +#endif mChangeDetected = true; break; } @@ -111,7 +120,7 @@ void DeviceSubscription::OnDone(ReadClient * apReadClient) // After calling mOnDoneCallback we are indicating that `this` is deleted and we shouldn't do anything else with // DeviceSubscription. MoveToState(State::AwaitingDestruction); - mOnDoneCallback(mCurrentAdministratorCommissioningAttributes.node_id); + mOnDoneCallback(mNodeId); } void DeviceSubscription::OnError(CHIP_ERROR error) @@ -126,7 +135,7 @@ void DeviceSubscription::OnDeviceConnected(Messaging::ExchangeManager & exchange // After calling mOnDoneCallback we are indicating that `this` is deleted and we shouldn't do anything else with // DeviceSubscription. MoveToState(State::AwaitingDestruction); - mOnDoneCallback(mCurrentAdministratorCommissioningAttributes.node_id); + mOnDoneCallback(mNodeId); return; } VerifyOrDie(mState == State::Connecting); @@ -151,7 +160,7 @@ void DeviceSubscription::OnDeviceConnected(Messaging::ExchangeManager & exchange // After calling mOnDoneCallback we are indicating that `this` is deleted and we shouldn't do anything else with // DeviceSubscription. MoveToState(State::AwaitingDestruction); - mOnDoneCallback(mCurrentAdministratorCommissioningAttributes.node_id); + mOnDoneCallback(mNodeId); return; } MoveToState(State::SubscriptionStarted); @@ -194,7 +203,7 @@ void DeviceSubscription::OnDeviceConnectionFailure(const ScopedNodeId & peerId, // After calling mOnDoneCallback we are indicating that `this` is deleted and we shouldn't do anything else with // DeviceSubscription. MoveToState(State::AwaitingDestruction); - mOnDoneCallback(mCurrentAdministratorCommissioningAttributes.node_id); + mOnDoneCallback(mNodeId); } CHIP_ERROR DeviceSubscription::StartSubscription(OnDoneCallback onDoneCallback, Controller::DeviceController & controller, @@ -203,10 +212,14 @@ CHIP_ERROR DeviceSubscription::StartSubscription(OnDoneCallback onDoneCallback, assertChipStackLockedByCurrentThread(); VerifyOrDie(mState == State::Idle); + mNodeId = nodeId; + +#if defined(PW_RPC_ENABLED) mCurrentAdministratorCommissioningAttributes = chip_rpc_AdministratorCommissioningChanged_init_default; mCurrentAdministratorCommissioningAttributes.node_id = nodeId; mCurrentAdministratorCommissioningAttributes.window_status = static_cast(Clusters::AdministratorCommissioning::CommissioningWindowStatusEnum::kWindowNotOpen); +#endif mOnDoneCallback = onDoneCallback; MoveToState(State::Connecting); @@ -243,5 +256,5 @@ void DeviceSubscription::StopSubscription() // After calling mOnDoneCallback we are indicating that `this` is deleted and we shouldn't do anything else with // DeviceSubscription. MoveToState(State::AwaitingDestruction); - mOnDoneCallback(mCurrentAdministratorCommissioningAttributes.node_id); + mOnDoneCallback(mNodeId); } diff --git a/examples/fabric-admin/device_manager/DeviceSubscription.h b/examples/fabric-admin/device_manager/DeviceSubscription.h index 353eb30c1c7158..5d8403777364b7 100644 --- a/examples/fabric-admin/device_manager/DeviceSubscription.h +++ b/examples/fabric-admin/device_manager/DeviceSubscription.h @@ -23,8 +23,10 @@ #include +#if defined(PW_RPC_ENABLED) #include "fabric_bridge_service/fabric_bridge_service.pb.h" #include "fabric_bridge_service/fabric_bridge_service.rpc.pb.h" +#endif class DeviceSubscriptionManager; @@ -32,7 +34,7 @@ class DeviceSubscriptionManager; /// via RPC when change has been identified. /// /// An instance of DeviceSubscription is intended to be used only once. Once a DeviceSubscription is -/// terminal, either from an error or from subscriptions getting shut down, we expect the instance +/// terminated, either from an error or from subscriptions getting shut down, we expect the instance /// to be deleted. Any new subscription should instantiate another instance of DeviceSubscription. class DeviceSubscription : public chip::app::ReadClient::Callback { @@ -78,13 +80,18 @@ class DeviceSubscription : public chip::app::ReadClient::Callback void MoveToState(const State aTargetState); const char * GetStateStr() const; + chip::NodeId mNodeId = chip::kUndefinedNodeId; + OnDoneCallback mOnDoneCallback; std::unique_ptr mClient; chip::Callback::Callback mOnDeviceConnectedCallback; chip::Callback::Callback mOnDeviceConnectionFailureCallback; +#if defined(PW_RPC_ENABLED) chip_rpc_AdministratorCommissioningChanged mCurrentAdministratorCommissioningAttributes; +#endif + bool mChangeDetected = false; State mState = State::Idle; }; diff --git a/examples/fabric-admin/device_manager/DeviceSubscriptionManager.cpp b/examples/fabric-admin/device_manager/DeviceSubscriptionManager.cpp index c59fd98192cd47..b485806bef6292 100644 --- a/examples/fabric-admin/device_manager/DeviceSubscriptionManager.cpp +++ b/examples/fabric-admin/device_manager/DeviceSubscriptionManager.cpp @@ -17,7 +17,10 @@ */ #include "DeviceSubscriptionManager.h" + +#if defined(PW_RPC_ENABLED) #include "rpc/RpcClient.h" +#endif #include #include diff --git a/examples/fabric-admin/device_manager/DeviceSynchronization.cpp b/examples/fabric-admin/device_manager/DeviceSynchronization.cpp index 6cc1cea690df2f..cbf84e23d0b2ed 100644 --- a/examples/fabric-admin/device_manager/DeviceSynchronization.cpp +++ b/examples/fabric-admin/device_manager/DeviceSynchronization.cpp @@ -19,7 +19,10 @@ #include "DeviceSynchronization.h" #include "DeviceSubscriptionManager.h" + +#if defined(PW_RPC_ENABLED) #include "rpc/RpcClient.h" +#endif #include #include @@ -44,6 +47,7 @@ void OnDeviceConnectionFailureWrapper(void * context, const ScopedNodeId & peerI reinterpret_cast(context)->OnDeviceConnectionFailure(peerId, error); } +#if defined(PW_RPC_ENABLED) bool SuccessOrLog(CHIP_ERROR err, const char * name) { if (err == CHIP_NO_ERROR) @@ -55,6 +59,7 @@ bool SuccessOrLog(CHIP_ERROR err, const char * name) return false; } +#endif } // namespace @@ -82,6 +87,7 @@ void DeviceSynchronizer::OnAttributeData(const ConcreteDataAttributePath & path, switch (path.mAttributeId) { +#if defined(PW_RPC_ENABLED) case Clusters::BasicInformation::Attributes::UniqueID::Id: mCurrentDeviceData.has_unique_id = SuccessOrLog(data->GetString(mCurrentDeviceData.unique_id, sizeof(mCurrentDeviceData.unique_id)), "UniqueId"); @@ -120,6 +126,7 @@ void DeviceSynchronizer::OnAttributeData(const ConcreteDataAttributePath & path, data->GetString(mCurrentDeviceData.software_version_string, sizeof(mCurrentDeviceData.software_version_string)), "SoftwareVersionString"); break; +#endif // #if defined(PW_RPC_ENABLED) default: break; } @@ -134,7 +141,7 @@ void DeviceSynchronizer::OnReportEnd() void DeviceSynchronizer::OnDone(chip::app::ReadClient * apReadClient) { #if defined(PW_RPC_ENABLED) - if (mState == State::ReceivedResponse && !DeviceMgr().IsCurrentBridgeDevice(mCurrentDeviceData.node_id)) + if (mState == State::ReceivedResponse && !DeviceMgr().IsCurrentBridgeDevice(mNodeId)) { GetUniqueId(); if (mState == State::GettingUid) @@ -197,10 +204,14 @@ void DeviceSynchronizer::StartDeviceSynchronization(chip::Controller::DeviceCont return; } + mNodeId = nodeId; + +#if defined(PW_RPC_ENABLED) mCurrentDeviceData = chip_rpc_SynchronizedDevice_init_default; mCurrentDeviceData.node_id = nodeId; mCurrentDeviceData.has_is_icd = true; mCurrentDeviceData.is_icd = deviceIsIcd; +#endif ReturnOnFailure(controller->GetConnectedDevice(nodeId, &mOnDeviceConnectedCallback, &mOnDeviceConnectionFailureCallback)); mController = controller; @@ -212,10 +223,12 @@ void DeviceSynchronizer::GetUniqueId() VerifyOrDie(mState == State::ReceivedResponse); VerifyOrDie(mController); +#if defined(PW_RPC_ENABLED) // If we have a UniqueId we can return leaving state in ReceivedResponse. VerifyOrReturn(!mCurrentDeviceData.has_unique_id, ChipLogDetail(NotSpecified, "We already have UniqueId")); +#endif - auto * device = DeviceMgr().FindDeviceByNode(mCurrentDeviceData.node_id); + auto * device = DeviceMgr().FindDeviceByNode(mNodeId); // If there is no associated remote Fabric Sync Aggregator there is no other place for us to try // getting the UniqueId from and can return leaving the state in ReceivedResponse. VerifyOrReturn(device, ChipLogDetail(NotSpecified, "No remote Fabric Sync Aggregator to get UniqueId from")); @@ -231,8 +244,10 @@ void DeviceSynchronizer::GetUniqueId() [this](std::optional aUniqueId) { if (aUniqueId.has_value()) { +#if defined(PW_RPC_ENABLED) this->mCurrentDeviceData.has_unique_id = true; memcpy(this->mCurrentDeviceData.unique_id, aUniqueId.value().data(), aUniqueId.value().size()); +#endif } else { @@ -255,19 +270,22 @@ void DeviceSynchronizer::GetUniqueId() void DeviceSynchronizer::SynchronizationCompleteAddDevice() { VerifyOrDie(mState == State::ReceivedResponse || mState == State::GettingUid); + +#if defined(PW_RPC_ENABLED) AddSynchronizedDevice(mCurrentDeviceData); // TODO(#35077) Figure out how we should reflect CADMIN values of ICD. if (!mCurrentDeviceData.is_icd) { VerifyOrDie(mController); // TODO(#35333) Figure out how we should recover in this circumstance. - CHIP_ERROR err = DeviceSubscriptionManager::Instance().StartSubscription(*mController, mCurrentDeviceData.node_id); + CHIP_ERROR err = DeviceSubscriptionManager::Instance().StartSubscription(*mController, mNodeId); if (err != CHIP_NO_ERROR) { - ChipLogError(NotSpecified, "Failed start subscription to NodeId:" ChipLogFormatX64, - ChipLogValueX64(mCurrentDeviceData.node_id)); + ChipLogError(NotSpecified, "Failed start subscription to NodeId:" ChipLogFormatX64, ChipLogValueX64(mNodeId)); } } +#endif + MoveToState(State::Idle); } diff --git a/examples/fabric-admin/device_manager/DeviceSynchronization.h b/examples/fabric-admin/device_manager/DeviceSynchronization.h index 11b640236268dd..28880c6faec7a1 100644 --- a/examples/fabric-admin/device_manager/DeviceSynchronization.h +++ b/examples/fabric-admin/device_manager/DeviceSynchronization.h @@ -25,8 +25,10 @@ #include +#if defined(PW_RPC_ENABLED) #include "fabric_bridge_service/fabric_bridge_service.pb.h" #include "fabric_bridge_service/fabric_bridge_service.rpc.pb.h" +#endif /// Ensures that device data is synchronized to the remote fabric bridge. /// @@ -92,6 +94,9 @@ class DeviceSynchronizer : public chip::app::ReadClient::Callback // mController is expected to remain valid throughout the entire device synchronization process (i.e. when // mState != Idle). chip::Controller::DeviceController * mController = nullptr; - chip_rpc_SynchronizedDevice mCurrentDeviceData = chip_rpc_SynchronizedDevice_init_default; + chip::NodeId mNodeId = chip::kUndefinedNodeId; +#if defined(PW_RPC_ENABLED) + chip_rpc_SynchronizedDevice mCurrentDeviceData = chip_rpc_SynchronizedDevice_init_default; +#endif UniqueIdGetter mUniqueIdGetter; }; From e1033521f8fb254a7815203ed7ee3eca1f2a41bd Mon Sep 17 00:00:00 2001 From: bakreanuj <85306569+bakreanuj@users.noreply.github.com> Date: Wed, 18 Sep 2024 05:17:15 -0700 Subject: [PATCH 14/47] Add chef sample app for dishwasher (#35465) * Update Matter data model/ZAP config for dishwasher * Add support for dishwasher alarm cluster * Add support for dishwasher mode cluster * Add support for dishwasher mode cluster * Update operational state delegate Emberexteral write and read callback * Restyled by whitespace * Restyled by clang-format * Restyled by gn * Update Zap config for dishwasher on TOT * Update Zap config for dishwasher on TOT * Resolve PR comments for dishwasher * Restyled by clang-format * rolve PR comments. --------- Co-authored-by: Restyled.io --- .../chef-dishwasher-alarm-delegate-impl.cpp | 147 +++ .../chef-dishwasher-mode-delegate-impl.cpp | 159 +++ .../chef-dishwasher-mode-delegate-impl.h | 90 ++ .../chef-operational-state-delegate-impl.cpp | 91 ++ .../chef-operational-state-delegate-impl.h | 14 +- examples/chef/common/stubs.cpp | 24 + .../rootnode_dishwasher_cc105034fe.matter | 305 ++++- .../rootnode_dishwasher_cc105034fe.zap | 1007 +++++++++++++++-- examples/chef/linux/BUILD.gn | 2 + examples/chef/nrfconnect/CMakeLists.txt | 2 + 10 files changed, 1744 insertions(+), 97 deletions(-) create mode 100644 examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp create mode 100644 examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp create mode 100644 examples/chef/common/chef-dishwasher-mode-delegate-impl.h diff --git a/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp b/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp new file mode 100644 index 00000000000000..aa1e9e66255672 --- /dev/null +++ b/examples/chef/common/chef-dishwasher-alarm-delegate-impl.cpp @@ -0,0 +1,147 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; + +#ifdef MATTER_DM_PLUGIN_DISHWASHER_ALARM_SERVER +#include +using namespace chip::app::Clusters::DishwasherAlarm; + +class DishwasherAlarmDelegate : public Delegate +{ +public: + /** + * @brief + * A notification that the Mask attribute will be changed. When this happens, some previously suppressed + * alarms may need to be enabled, and previously enabled alarms may need to be suppressed. + * @param[in] mask The new value of the Mask attribute. + * @return The cluster will do this update if ModifyEnabledAlarmsCallback() returns true. + * The cluster will not do this update if ModifyEnabledAlarmsCallback() returns false. + */ + bool ModifyEnabledAlarmsCallback(const BitMask mask) override; + + /** + * @brief + * A notification that resets active alarms (if possible) + * @param[in] alarms The value of reset alarms + * @return The cluster will reset active alarms if ResetAlarmsCallback() returns true. + * The cluster will not reset active alarms if ResetAlarmsCallback() returns false. + */ + bool ResetAlarmsCallback(const BitMask alarms) override; + + ~DishwasherAlarmDelegate() = default; +}; + +bool DishwasherAlarmDelegate::ModifyEnabledAlarmsCallback(const BitMask mask) +{ + // placeholder implementation + return true; +} + +bool DishwasherAlarmDelegate::ResetAlarmsCallback(const BitMask alarms) +{ + // placeholder implementation + return true; +} + +/* + * An example to present device's endpointId + */ +static constexpr EndpointId kDemoEndpointId = 1; + +void MatterDishwasherAlarmServerInit() +{ + using namespace app::Clusters; + using namespace app::Clusters::DishwasherAlarm; + + static DishwasherAlarm::DishwasherAlarmDelegate delegate; + DishwasherAlarm::SetDefaultDelegate(kDemoEndpointId, &delegate); + + // Set Supported attribute = 0x3F = 63 + // Bit Name Value + // 0 InflowError 1 + // 1 DrainError 1 + // 2 DoorError 1 + // 3 TempTooLow 1 + // 4 TempTooHigh 1 + // 5 WaterLevelError 1 + BitMask supported; + supported.SetField(AlarmMap::kInflowError, 1); + supported.SetField(AlarmMap::kDrainError, 1); + supported.SetField(AlarmMap::kDoorError, 1); + supported.SetField(AlarmMap::kTempTooLow, 1); + supported.SetField(AlarmMap::kTempTooHigh, 1); + supported.SetField(AlarmMap::kWaterLevelError, 1); + DishwasherAlarmServer::Instance().SetSupportedValue(kDemoEndpointId, supported); + + // Set Mask attribute = 0x0 = 0 + // Bit Name Value + // 0 InflowError 0 + // 1 DrainError 0 + // 2 DoorError 0 + // 3 TempTooLow 0 + // 4 TempTooHigh 0 + // 5 WaterLevelError 0 + BitMask mask; + mask.SetField(AlarmMap::kInflowError, 0); + mask.SetField(AlarmMap::kDrainError, 0); + mask.SetField(AlarmMap::kDoorError, 0); + mask.SetField(AlarmMap::kTempTooLow, 0); + mask.SetField(AlarmMap::kTempTooHigh, 0); + mask.SetField(AlarmMap::kWaterLevelError, 0); + DishwasherAlarmServer::Instance().SetMaskValue(kDemoEndpointId, mask); + + // Set Latch attribute = 0x30 + // Bit Name Value + // 0 InflowError 1 + // 1 DrainError 1 + // 2 DoorError 0 + // 3 TempTooLow 0 + // 4 TempTooHigh 0 + // 5 WaterLevelError 0 + BitMask latch; + latch.SetField(AlarmMap::kInflowError, 1); + latch.SetField(AlarmMap::kDrainError, 1); + latch.SetField(AlarmMap::kDoorError, 0); + latch.SetField(AlarmMap::kTempTooLow, 0); + latch.SetField(AlarmMap::kTempTooHigh, 0); + latch.SetField(AlarmMap::kWaterLevelError, 0); + DishwasherAlarmServer::Instance().SetLatchValue(kDemoEndpointId, latch); + + // Set State attribute = 0x00 + // Bit Name Value + // 0 InflowError 0 + // 1 DrainError 0 + // 2 DoorError 0 + // 3 TempTooLow 0 + // 4 TempTooHigh 0 + // 5 WaterLevelError 0 + BitMask state; + state.SetField(AlarmMap::kInflowError, 0); + state.SetField(AlarmMap::kDrainError, 0); + state.SetField(AlarmMap::kDoorError, 0); + state.SetField(AlarmMap::kTempTooLow, 0); + state.SetField(AlarmMap::kTempTooHigh, 0); + state.SetField(AlarmMap::kWaterLevelError, 0); + DishwasherAlarmServer::Instance().SetStateValue(kDemoEndpointId, state); +} + +#endif // MATTER_DM_PLUGIN_DISHWASHER_ALARM_SERVER diff --git a/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp b/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp new file mode 100644 index 00000000000000..b5206ef407dab6 --- /dev/null +++ b/examples/chef/common/chef-dishwasher-mode-delegate-impl.cpp @@ -0,0 +1,159 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +#include +#include + +using namespace chip; +using namespace chip::app; +using namespace chip::app::Clusters; +using chip::Protocols::InteractionModel::Status; +template +using List = chip::app::DataModel::List; +using ModeTagStructType = chip::app::Clusters::detail::Structs::ModeTagStruct::Type; + +#ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER +#include +using namespace chip::app::Clusters::DishwasherMode; + +static std::unique_ptr gDishwasherModeDelegate; +static std::unique_ptr gDishwasherModeInstance; + +CHIP_ERROR DishwasherModeDelegate::Init() +{ + return CHIP_NO_ERROR; +} + +void DishwasherModeDelegate::HandleChangeToMode(uint8_t NewMode, ModeBase::Commands::ChangeToModeResponse::Type & response) +{ + response.status = to_underlying(ModeBase::StatusCode::kSuccess); +} + +CHIP_ERROR DishwasherModeDelegate::GetModeLabelByIndex(uint8_t modeIndex, chip::MutableCharSpan & label) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + return chip::CopyCharSpanToMutableCharSpan(kModeOptions[modeIndex].label, label); +} + +CHIP_ERROR DishwasherModeDelegate::GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + value = kModeOptions[modeIndex].mode; + return CHIP_NO_ERROR; +} + +CHIP_ERROR DishwasherModeDelegate::GetModeTagsByIndex(uint8_t modeIndex, List & tags) +{ + if (modeIndex >= ArraySize(kModeOptions)) + { + return CHIP_ERROR_PROVIDER_LIST_EXHAUSTED; + } + + if (tags.size() < kModeOptions[modeIndex].modeTags.size()) + { + return CHIP_ERROR_INVALID_ARGUMENT; + } + + std::copy(kModeOptions[modeIndex].modeTags.begin(), kModeOptions[modeIndex].modeTags.end(), tags.begin()); + tags.reduce_size(kModeOptions[modeIndex].modeTags.size()); + + return CHIP_NO_ERROR; +} + +// ModeBase::Instance * DishwasherMode::Instance() +// { +// return gDishwasherModeInstance; +// } + +void DishwasherMode::Shutdown() +{ + gDishwasherModeInstance.reset(); + gDishwasherModeDelegate.reset(); +} + +chip::Protocols::InteractionModel::Status chefDishwasherModeWriteCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer) +{ + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1 + VerifyOrDie(gDishwasherModeInstance != nullptr); + chip::Protocols::InteractionModel::Status ret; + chip::AttributeId attributeId = attributeMetadata->attributeId; + + switch (attributeId) + { + case chip::app::Clusters::DishwasherMode::Attributes::CurrentMode::Id: { + uint8_t m = static_cast(buffer[0]); + ret = gDishwasherModeInstance->UpdateCurrentMode(m); + if (chip::Protocols::InteractionModel::Status::Success != ret) + { + ChipLogError(DeviceLayer, "Invalid Attribute Write to CurrentMode : %d", static_cast(ret)); + } + } + break; + default: + ret = chip::Protocols::InteractionModel::Status::UnsupportedWrite; + ChipLogError(DeviceLayer, "Unsupported Writng Attribute ID: %d", static_cast(attributeId)); + break; + } + + return ret; +} + +chip::Protocols::InteractionModel::Status chefDishwasherModeReadCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength) +{ + VerifyOrReturnValue(maxReadLength == 1, chip::Protocols::InteractionModel::Status::ResourceExhausted); + buffer[0] = gDishwasherModeInstance->GetCurrentMode(); + + chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success; + chip::AttributeId attributeId = attributeMetadata->attributeId; + + switch (attributeId) + { + case chip::app::Clusters::DishwasherMode::Attributes::CurrentMode::Id: { + *buffer = gDishwasherModeInstance->GetCurrentMode(); + ChipLogDetail(DeviceLayer, "Reading DishwasherMode CurrentMode : %d", static_cast(attributeId)); + } + break; + default: + ret = chip::Protocols::InteractionModel::Status::UnsupportedRead; + ChipLogDetail(DeviceLayer, "Unsupported attributeId %d from reading DishwasherMode", static_cast(attributeId)); + break; + } + + return ret; +} + +void emberAfDishwasherModeClusterInitCallback(chip::EndpointId endpointId) +{ + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. + VerifyOrDie(!gDishwasherModeDelegate && !gDishwasherModeInstance); + + gDishwasherModeDelegate = std::make_unique(); + gDishwasherModeInstance = std::make_unique(gDishwasherModeDelegate.get(), endpointId, DishwasherMode::Id, + chip::to_underlying(Feature::kOnOff)); + gDishwasherModeInstance->Init(); +} +#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER diff --git a/examples/chef/common/chef-dishwasher-mode-delegate-impl.h b/examples/chef/common/chef-dishwasher-mode-delegate-impl.h new file mode 100644 index 00000000000000..547ffe725fce0d --- /dev/null +++ b/examples/chef/common/chef-dishwasher-mode-delegate-impl.h @@ -0,0 +1,90 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include +#include + +using chip::Protocols::InteractionModel::Status; + +namespace chip { +namespace app { +namespace Clusters { + +namespace DishwasherMode { + +const uint8_t ModeNormal = 0; +const uint8_t ModeHeavy = 1; +const uint8_t ModeLight = 2; + +/// This is an application level delegate to handle DishwasherMode commands according to the specific business logic. +class DishwasherModeDelegate : public ModeBase::Delegate +{ +private: + using ModeTagStructType = detail::Structs::ModeTagStruct::Type; + ModeTagStructType modeTagsNormal[1] = { { .value = to_underlying(ModeTag::kNormal) } }; + ModeTagStructType modeTagsHeavy[2] = { { .value = to_underlying(ModeBase::ModeTag::kMax) }, + { .value = to_underlying(ModeTag::kHeavy) } }; + ModeTagStructType modeTagsLight[3] = { { .value = to_underlying(ModeTag::kLight) }, + { .value = to_underlying(ModeBase::ModeTag::kNight) }, + { .value = to_underlying(ModeBase::ModeTag::kQuiet) } }; + + const detail::Structs::ModeOptionStruct::Type kModeOptions[3] = { + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Normal"), + .mode = ModeNormal, + .modeTags = DataModel::List(modeTagsNormal) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Heavy"), + .mode = ModeHeavy, + .modeTags = DataModel::List(modeTagsHeavy) }, + detail::Structs::ModeOptionStruct::Type{ .label = CharSpan::fromCharString("Light"), + .mode = ModeLight, + .modeTags = DataModel::List(modeTagsLight) } + }; + + CHIP_ERROR Init() override; + void HandleChangeToMode(uint8_t mode, ModeBase::Commands::ChangeToModeResponse::Type & response) override; + + CHIP_ERROR GetModeLabelByIndex(uint8_t modeIndex, MutableCharSpan & label) override; + CHIP_ERROR GetModeValueByIndex(uint8_t modeIndex, uint8_t & value) override; + CHIP_ERROR GetModeTagsByIndex(uint8_t modeIndex, DataModel::List & tags) override; + +public: + ~DishwasherModeDelegate() override = default; +}; + +ModeBase::Instance * Instance(); + +void Shutdown(); + +} // namespace DishwasherMode + +} // namespace Clusters +} // namespace app +} // namespace chip + +#ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER +chip::Protocols::InteractionModel::Status chefDishwasherModeWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer); +chip::Protocols::InteractionModel::Status chefDishwasherModeReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength); +#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER diff --git a/examples/chef/common/chef-operational-state-delegate-impl.cpp b/examples/chef/common/chef-operational-state-delegate-impl.cpp index eedd141dc3b2e4..5e94acddc0e1ee 100644 --- a/examples/chef/common/chef-operational-state-delegate-impl.cpp +++ b/examples/chef/common/chef-operational-state-delegate-impl.cpp @@ -14,14 +14,18 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +#include +#include #include #include +#ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER using namespace chip; using namespace chip::app; using namespace chip::app::Clusters; using namespace chip::app::Clusters::OperationalState; using namespace chip::app::Clusters::RvcOperationalState; +using chip::Protocols::InteractionModel::Status; static void onOperationalStateTimerTick(System::Layer * systemLayer, void * data); @@ -201,6 +205,91 @@ void OperationalState::Shutdown() } } +chip::Protocols::InteractionModel::Status chefOperationalStateWriteCallback(chip::EndpointId endpointId, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer) +{ + chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success; + VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. + VerifyOrDie(gOperationalStateInstance != nullptr); + chip::AttributeId attributeId = attributeMetadata->attributeId; + + switch (attributeId) + { + case chip::app::Clusters::OperationalState::Attributes::CurrentPhase::Id: { + uint8_t m = static_cast(buffer[0]); + DataModel::Nullable aPhase(m); + CHIP_ERROR err = gOperationalStateInstance->SetCurrentPhase(aPhase); + if (CHIP_NO_ERROR == err) + { + break; + } + ret = chip::Protocols::InteractionModel::Status::ConstraintError; + ChipLogError(DeviceLayer, "Invalid Attribute Update status: %" CHIP_ERROR_FORMAT, err.Format()); + } + break; + case chip::app::Clusters::OperationalState::Attributes::OperationalState::Id: { + uint8_t currentState = gOperationalStateInstance->GetCurrentOperationalState(); + uint8_t m = static_cast(buffer[0]); + CHIP_ERROR err = gOperationalStateInstance->SetOperationalState(m); + + if (currentState == to_underlying(OperationalState::OperationalStateEnum::kStopped) && + m == to_underlying(OperationalState::OperationalStateEnum::kRunning)) + { + gOperationalStateDelegate->mCountDownTime.SetNonNull( + static_cast(gOperationalStateDelegate->kExampleCountDown)); + (void) DeviceLayer::SystemLayer().StartTimer(System::Clock::Seconds16(1), onOperationalStateTimerTick, + gOperationalStateDelegate); + } + + if (CHIP_NO_ERROR == err) + { + break; + } + ret = chip::Protocols::InteractionModel::Status::ConstraintError; + ChipLogError(DeviceLayer, "Invalid Attribute Update status: %" CHIP_ERROR_FORMAT, err.Format()); + } + break; + default: + ret = chip::Protocols::InteractionModel::Status::UnsupportedAttribute; + ChipLogError(DeviceLayer, "Unsupported Attribute ID: %d", static_cast(attributeId)); + break; + } + + return ret; +} + +chip::Protocols::InteractionModel::Status chefOperationalStateReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength) +{ + chip::Protocols::InteractionModel::Status ret = chip::Protocols::InteractionModel::Status::Success; + chip::AttributeId attributeId = attributeMetadata->attributeId; + switch (attributeId) + { + case chip::app::Clusters::OperationalState::Attributes::CurrentPhase::Id: { + + app::DataModel::Nullable currentPhase = gOperationalStateInstance->GetCurrentPhase(); + if (currentPhase.IsNull()) + { + ret = chip::Protocols::InteractionModel::Status::UnsupportedAttribute; + break; + } + *buffer = currentPhase.Value(); + } + break; + case chip::app::Clusters::OperationalState::Attributes::OperationalState::Id: { + *buffer = gOperationalStateInstance->GetCurrentOperationalState(); + } + break; + default: + ChipLogError(DeviceLayer, "Unsupported Attribute ID: %d", static_cast(attributeId)); + break; + } + + return ret; +} + void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpointId) { VerifyOrDie(endpointId == 1); // this cluster is only enabled for endpoint 1. @@ -214,3 +303,5 @@ void emberAfOperationalStateClusterInitCallback(chip::EndpointId endpointId) gOperationalStateInstance->Init(); } + +#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER diff --git a/examples/chef/common/chef-operational-state-delegate-impl.h b/examples/chef/common/chef-operational-state-delegate-impl.h index badadd68cd30a9..884a6f28c2828c 100644 --- a/examples/chef/common/chef-operational-state-delegate-impl.h +++ b/examples/chef/common/chef-operational-state-delegate-impl.h @@ -23,6 +23,9 @@ #include +#ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER +using chip::Protocols::InteractionModel::Status; + namespace chip { namespace app { namespace Clusters { @@ -108,9 +111,9 @@ class OperationalStateDelegate : public GenericOperationalStateDelegateImpl GenericOperationalState(to_underlying(OperationalStateEnum::kError)), }; +public: const uint32_t kExampleCountDown = 30; -public: OperationalStateDelegate() { GenericOperationalStateDelegateImpl::mOperationalStateList = Span(opStateList); @@ -146,3 +149,12 @@ void Shutdown(); } // namespace Clusters } // namespace app } // namespace chip + +chip::Protocols::InteractionModel::Status chefOperationalStateWriteCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer); +chip::Protocols::InteractionModel::Status chefOperationalStateReadCallback(chip::EndpointId endpoint, chip::ClusterId clusterId, + const EmberAfAttributeMetadata * attributeMetadata, + uint8_t * buffer, uint16_t maxReadLength); + +#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER diff --git a/examples/chef/common/stubs.cpp b/examples/chef/common/stubs.cpp index f7b4b491451b0e..6ec7c9e92f4cd0 100644 --- a/examples/chef/common/stubs.cpp +++ b/examples/chef/common/stubs.cpp @@ -30,6 +30,14 @@ #include "chef-rvc-operational-state-delegate.h" #endif +#ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER +#include "chef-dishwasher-mode-delegate-impl.h" +#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER + +#ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER +#include "chef-operational-state-delegate-impl.h" +#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER + using chip::app::DataModel::Nullable; using namespace chip; @@ -85,6 +93,14 @@ Protocols::InteractionModel::Status emberAfExternalAttributeReadCallback(Endpoin case chip::app::Clusters::RvcOperationalState::Id: return chefRvcOperationalStateReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); #endif +#ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER + case chip::app::Clusters::DishwasherMode::Id: + return chefDishwasherModeReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); +#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER +#ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER + case chip::app::Clusters::OperationalState::Id: + return chefOperationalStateReadCallback(endpoint, clusterId, attributeMetadata, buffer, maxReadLength); +#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER default: break; } @@ -150,6 +166,14 @@ Protocols::InteractionModel::Status emberAfExternalAttributeWriteCallback(Endpoi case chip::app::Clusters::RvcOperationalState::Id: return chefRvcOperationalStateWriteCallback(endpoint, clusterId, attributeMetadata, buffer); #endif +#ifdef MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER + case chip::app::Clusters::DishwasherMode::Id: + return chefDishwasherModeWriteCallback(endpoint, clusterId, attributeMetadata, buffer); +#endif // MATTER_DM_PLUGIN_DISHWASHER_MODE_SERVER +#ifdef MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER + case chip::app::Clusters::OperationalState::Id: + return chefOperationalStateWriteCallback(endpoint, clusterId, attributeMetadata, buffer); +#endif // MATTER_DM_PLUGIN_OPERATIONAL_STATE_SERVER default: break; } diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter index 4ab3e0f003c457..7ad1d3487e8c2b 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.matter @@ -284,6 +284,78 @@ cluster Identify = 3 { command access(invoke: manage) TriggerEffect(TriggerEffectRequest): DefaultSuccess = 64; } +/** Attributes and commands for switching devices between 'On' and 'Off' states. */ +cluster OnOff = 6 { + revision 6; + + enum DelayedAllOffEffectVariantEnum : enum8 { + kDelayedOffFastFade = 0; + kNoFade = 1; + kDelayedOffSlowFade = 2; + } + + enum DyingLightEffectVariantEnum : enum8 { + kDyingLightFadeOff = 0; + } + + enum EffectIdentifierEnum : enum8 { + kDelayedAllOff = 0; + kDyingLight = 1; + } + + enum StartUpOnOffEnum : enum8 { + kOff = 0; + kOn = 1; + kToggle = 2; + } + + bitmap Feature : bitmap32 { + kLighting = 0x1; + kDeadFrontBehavior = 0x2; + kOffOnly = 0x4; + } + + bitmap OnOffControlBitmap : bitmap8 { + kAcceptOnlyWhenOn = 0x1; + } + + readonly attribute boolean onOff = 0; + readonly attribute optional boolean globalSceneControl = 16384; + attribute optional int16u onTime = 16385; + attribute optional int16u offWaitTime = 16386; + attribute access(write: manage) optional nullable StartUpOnOffEnum startUpOnOff = 16387; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct OffWithEffectRequest { + EffectIdentifierEnum effectIdentifier = 0; + enum8 effectVariant = 1; + } + + request struct OnWithTimedOffRequest { + OnOffControlBitmap onOffControl = 0; + int16u onTime = 1; + int16u offWaitTime = 2; + } + + /** On receipt of this command, a device SHALL enter its ‘Off’ state. This state is device dependent, but it is recommended that it is used for power off or similar functions. On receipt of the Off command, the OnTime attribute SHALL be set to 0. */ + command Off(): DefaultSuccess = 0; + /** On receipt of this command, a device SHALL enter its ‘On’ state. This state is device dependent, but it is recommended that it is used for power on or similar functions. On receipt of the On command, if the value of the OnTime attribute is equal to 0, the device SHALL set the OffWaitTime attribute to 0. */ + command On(): DefaultSuccess = 1; + /** On receipt of this command, if a device is in its ‘Off’ state it SHALL enter its ‘On’ state. Otherwise, if it is in its ‘On’ state it SHALL enter its ‘Off’ state. On receipt of the Toggle command, if the value of the OnOff attribute is equal to FALSE and if the value of the OnTime attribute is equal to 0, the device SHALL set the OffWaitTime attribute to 0. If the value of the OnOff attribute is equal to TRUE, the OnTime attribute SHALL be set to 0. */ + command Toggle(): DefaultSuccess = 2; + /** The OffWithEffect command allows devices to be turned off using enhanced ways of fading. */ + command OffWithEffect(OffWithEffectRequest): DefaultSuccess = 64; + /** The OnWithRecallGlobalScene command allows the recall of the settings when the device was turned off. */ + command OnWithRecallGlobalScene(): DefaultSuccess = 65; + /** The OnWithTimedOff command allows devices to be turned on for a specific duration with a guarded off duration so that SHOULD the device be subsequently switched off, further OnWithTimedOff commands, received during this time, are prevented from turning the devices back on. */ + command OnWithTimedOff(OnWithTimedOffRequest): DefaultSuccess = 66; +} + /** The Descriptor Cluster is meant to replace the support from the Zigbee Device Object (ZDO) for describing a node, its endpoints and clusters. */ cluster Descriptor = 29 { revision 2; @@ -539,6 +611,23 @@ cluster BasicInformation = 40 { command MfgSpecificPing(): DefaultSuccess = 0; } +/** Nodes should be expected to be deployed to any and all regions of the world. These global regions + may have differing common languages, units of measurements, and numerical formatting + standards. As such, Nodes that visually or audibly convey information need a mechanism by which + they can be configured to use a user’s preferred language, units, etc */ +cluster LocalizationConfiguration = 43 { + revision 1; // NOTE: Default/not specifically set + + attribute access(write: manage) char_string<35> activeLocale = 0; + readonly attribute char_string supportedLocales[] = 1; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; +} + /** Nodes should be expected to be deployed to any and all regions of the world. These global regions may have differing preferences for the units in which values are conveyed in communication to a user. As such, Nodes that visually or audibly convey measurable values to the user need a @@ -1298,6 +1387,147 @@ cluster GroupKeyManagement = 63 { fabric command access(invoke: administer) KeySetReadAllIndices(): KeySetReadAllIndicesResponse = 4; } +/** Attributes and commands for configuring the temperature control, and reporting temperature. */ +cluster TemperatureControl = 86 { + revision 1; // NOTE: Default/not specifically set + + bitmap Feature : bitmap32 { + kTemperatureNumber = 0x1; + kTemperatureLevel = 0x2; + kTemperatureStep = 0x4; + } + + readonly attribute optional temperature temperatureSetpoint = 0; + readonly attribute optional temperature minTemperature = 1; + readonly attribute optional temperature maxTemperature = 2; + readonly attribute optional temperature step = 3; + readonly attribute optional int8u selectedTemperatureLevel = 4; + readonly attribute optional char_string supportedTemperatureLevels[] = 5; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct SetTemperatureRequest { + optional temperature targetTemperature = 0; + optional int8u targetTemperatureLevel = 1; + } + + /** Set Temperature */ + command SetTemperature(SetTemperatureRequest): DefaultSuccess = 0; +} + +/** Attributes and commands for selecting a mode from a list of supported options. */ +cluster DishwasherMode = 89 { + revision 2; + + enum ModeTag : enum16 { + kAuto = 0; + kQuick = 1; + kQuiet = 2; + kLowNoise = 3; + kLowEnergy = 4; + kVacation = 5; + kMin = 6; + kMax = 7; + kNight = 8; + kDay = 9; + kNormal = 16384; + kHeavy = 16385; + kLight = 16386; + } + + bitmap Feature : bitmap32 { + kOnOff = 0x1; + } + + struct ModeTagStruct { + optional vendor_id mfgCode = 0; + enum16 value = 1; + } + + struct ModeOptionStruct { + char_string<64> label = 0; + int8u mode = 1; + ModeTagStruct modeTags[] = 2; + } + + readonly attribute ModeOptionStruct supportedModes[] = 0; + readonly attribute int8u currentMode = 1; + attribute optional nullable int8u startUpMode = 2; + attribute optional nullable int8u onMode = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ChangeToModeRequest { + int8u newMode = 0; + } + + response struct ChangeToModeResponse = 1 { + enum8 status = 0; + optional char_string statusText = 1; + } + + /** This command is used to change device modes. + On receipt of this command the device SHALL respond with a ChangeToModeResponse command. */ + command ChangeToMode(ChangeToModeRequest): ChangeToModeResponse = 0; +} + +/** Attributes and commands for configuring the Dishwasher alarm. */ +cluster DishwasherAlarm = 93 { + revision 1; // NOTE: Default/not specifically set + + bitmap AlarmBitmap : bitmap32 { + kInflowError = 0x1; + kDrainError = 0x2; + kDoorError = 0x4; + kTempTooLow = 0x8; + kTempTooHigh = 0x10; + kWaterLevelError = 0x20; + } + + bitmap Feature : bitmap32 { + kReset = 0x1; + } + + info event Notify = 0 { + AlarmBitmap active = 0; + AlarmBitmap inactive = 1; + AlarmBitmap state = 2; + AlarmBitmap mask = 3; + } + + readonly attribute AlarmBitmap mask = 0; + readonly attribute optional AlarmBitmap latch = 1; + readonly attribute AlarmBitmap state = 2; + readonly attribute AlarmBitmap supported = 3; + readonly attribute command_id generatedCommandList[] = 65528; + readonly attribute command_id acceptedCommandList[] = 65529; + readonly attribute event_id eventList[] = 65530; + readonly attribute attrib_id attributeList[] = 65531; + readonly attribute bitmap32 featureMap = 65532; + readonly attribute int16u clusterRevision = 65533; + + request struct ResetRequest { + AlarmBitmap alarms = 0; + } + + request struct ModifyEnabledAlarmsRequest { + AlarmBitmap mask = 0; + } + + /** Reset alarm */ + command Reset(ResetRequest): DefaultSuccess = 0; + /** Modify enabled alarms */ + command ModifyEnabledAlarms(ModifyEnabledAlarmsRequest): DefaultSuccess = 1; +} + /** This cluster supports remotely monitoring and, where supported, changing the operational state of any device where a state machine is a part of the operation. */ cluster OperationalState = 96 { revision 1; @@ -1428,6 +1658,17 @@ endpoint 0 { ram attribute clusterRevision default = 3; } + server cluster LocalizationConfiguration { + ram attribute activeLocale; + callback attribute supportedLocales; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 0; + ram attribute clusterRevision default = 1; + } + server cluster UnitLocalization { persist attribute temperatureUnit default = 0; callback attribute generatedCommandList; @@ -1600,12 +1841,26 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 4; + ram attribute clusterRevision default = 5; handle command Identify; handle command TriggerEffect; } + server cluster OnOff { + ram attribute onOff default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 2; + ram attribute clusterRevision default = 6; + + handle command Off; + handle command On; + handle command Toggle; + } + server cluster Descriptor { callback attribute deviceTypeList; callback attribute serverList; @@ -1618,6 +1873,52 @@ endpoint 1 { callback attribute clusterRevision; } + server cluster TemperatureControl { + ram attribute temperatureSetpoint default = 0; + ram attribute minTemperature default = 0; + ram attribute maxTemperature default = 0; + ram attribute step default = 0; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 5; + ram attribute clusterRevision default = 1; + + handle command SetTemperature; + } + + server cluster DishwasherMode { + callback attribute supportedModes; + callback attribute currentMode; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + callback attribute featureMap; + ram attribute clusterRevision default = 2; + + handle command ChangeToMode; + handle command ChangeToModeResponse; + } + + server cluster DishwasherAlarm { + emits event Notify; + ram attribute mask default = 0; + ram attribute latch default = 0x30; + ram attribute state default = 0; + ram attribute supported default = 0x3F; + callback attribute generatedCommandList; + callback attribute acceptedCommandList; + callback attribute eventList; + callback attribute attributeList; + ram attribute featureMap default = 1; + ram attribute clusterRevision default = 1; + + handle command Reset; + handle command ModifyEnabledAlarms; + } + server cluster OperationalState { emits event OperationalError; emits event OperationCompletion; @@ -1631,7 +1932,7 @@ endpoint 1 { callback attribute acceptedCommandList; callback attribute attributeList; ram attribute featureMap default = 0; - ram attribute clusterRevision default = 1; + ram attribute clusterRevision default = 3; handle command Pause; handle command Stop; diff --git a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap index bedf611487efa1..3ad6e7deb236e0 100644 --- a/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap +++ b/examples/chef/devices/rootnode_dishwasher_cc105034fe.zap @@ -866,6 +866,144 @@ } ] }, + { + "name": "Localization Configuration", + "code": 43, + "mfgCode": null, + "define": "LOCALIZATION_CONFIGURATION_CLUSTER", + "side": "server", + "enabled": 1, + "attributes": [ + { + "name": "ActiveLocale", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "char_string", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "SupportedLocales", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": "", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, { "name": "Unit Localization", "code": 45, @@ -2822,7 +2960,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "4", + "defaultValue": "5", "reportable": 1, "minInterval": 0, "maxInterval": 65344, @@ -2831,64 +2969,58 @@ ] }, { - "name": "Descriptor", - "code": 29, + "name": "On/Off", + "code": 6, "mfgCode": null, - "define": "DESCRIPTOR_CLUSTER", + "define": "ON_OFF_CLUSTER", "side": "server", "enabled": 1, - "attributes": [ + "commands": [ { - "name": "DeviceTypeList", + "name": "Off", "code": 0, "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 + "source": "client", + "isIncoming": 1, + "isEnabled": 1 }, { - "name": "ServerList", + "name": "On", "code": 1, "mfgCode": null, - "side": "server", - "type": "array", - "included": 1, - "storageOption": "External", - "singleton": 0, - "bounded": 0, - "defaultValue": null, - "reportable": 1, - "minInterval": 1, - "maxInterval": 65534, - "reportableChange": 0 + "source": "client", + "isIncoming": 1, + "isEnabled": 1 }, { - "name": "ClientList", + "name": "Toggle", "code": 2, "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "OnOff", + "code": 0, + "mfgCode": null, "side": "server", - "type": "array", + "type": "boolean", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "0", "reportable": 1, "minInterval": 1, "maxInterval": 65534, "reportableChange": 0 }, { - "name": "PartsList", - "code": 3, + "name": "GeneratedCommandList", + "code": 65528, "mfgCode": null, "side": "server", "type": "array", @@ -2903,8 +3035,8 @@ "reportableChange": 0 }, { - "name": "GeneratedCommandList", - "code": 65528, + "name": "AcceptedCommandList", + "code": 65529, "mfgCode": null, "side": "server", "type": "array", @@ -2919,8 +3051,8 @@ "reportableChange": 0 }, { - "name": "AcceptedCommandList", - "code": 65529, + "name": "EventList", + "code": 65530, "mfgCode": null, "side": "server", "type": "array", @@ -2957,10 +3089,10 @@ "side": "server", "type": "bitmap32", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "2", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2973,10 +3105,10 @@ "side": "server", "type": "int16u", "included": 1, - "storageOption": "External", + "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": null, + "defaultValue": "6", "reportable": 1, "minInterval": 1, "maxInterval": 65534, @@ -2985,57 +3117,15 @@ ] }, { - "name": "Operational State", - "code": 96, + "name": "Descriptor", + "code": 29, "mfgCode": null, - "define": "OPERATIONAL_STATE_CLUSTER", + "define": "DESCRIPTOR_CLUSTER", "side": "server", "enabled": 1, - "commands": [ - { - "name": "Pause", - "code": 0, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "Stop", - "code": 1, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "Start", - "code": 2, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "Resume", - "code": 3, - "mfgCode": null, - "source": "client", - "isIncoming": 1, - "isEnabled": 1 - }, - { - "name": "OperationalCommandResponse", - "code": 4, - "mfgCode": null, - "source": "server", - "isIncoming": 0, - "isEnabled": 1 - } - ], "attributes": [ { - "name": "PhaseList", + "name": "DeviceTypeList", "code": 0, "mfgCode": null, "side": "server", @@ -3051,11 +3141,11 @@ "reportableChange": 0 }, { - "name": "CurrentPhase", + "name": "ServerList", "code": 1, "mfgCode": null, "side": "server", - "type": "int8u", + "type": "array", "included": 1, "storageOption": "External", "singleton": 0, @@ -3067,11 +3157,740 @@ "reportableChange": 0 }, { - "name": "CountdownTime", + "name": "ClientList", "code": 2, "mfgCode": null, "side": "server", - "type": "elapsed_s", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "PartsList", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "3", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Temperature Control", + "code": 86, + "mfgCode": null, + "define": "TEMPERATURE_CONTROL_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "SetTemperature", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "TemperatureSetpoint", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MinTemperature", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "MaxTemperature", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Step", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "temperature", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "5", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Dishwasher Mode", + "code": 89, + "mfgCode": null, + "define": "DISHWASHER_MODE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "ChangeToMode", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ChangeToModeResponse", + "code": 1, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "SupportedModes", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentMode", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "2", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ] + }, + { + "name": "Dishwasher Alarm", + "code": 93, + "mfgCode": null, + "define": "DISHWASHER_ALARM_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Reset", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "ModifyEnabledAlarms", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "Mask", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Latch", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x30", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "State", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "Supported", + "code": 3, + "mfgCode": null, + "side": "server", + "type": "AlarmBitmap", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "0x3F", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "GeneratedCommandList", + "code": 65528, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AcceptedCommandList", + "code": 65529, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "EventList", + "code": 65530, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "AttributeList", + "code": 65531, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "FeatureMap", + "code": 65532, + "mfgCode": null, + "side": "server", + "type": "bitmap32", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "ClusterRevision", + "code": 65533, + "mfgCode": null, + "side": "server", + "type": "int16u", + "included": 1, + "storageOption": "RAM", + "singleton": 0, + "bounded": 0, + "defaultValue": "1", + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + } + ], + "events": [ + { + "name": "Notify", + "code": 0, + "mfgCode": null, + "side": "server", + "included": 1 + } + ] + }, + { + "name": "Operational State", + "code": 96, + "mfgCode": null, + "define": "OPERATIONAL_STATE_CLUSTER", + "side": "server", + "enabled": 1, + "commands": [ + { + "name": "Pause", + "code": 0, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Stop", + "code": 1, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Start", + "code": 2, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "Resume", + "code": 3, + "mfgCode": null, + "source": "client", + "isIncoming": 1, + "isEnabled": 1 + }, + { + "name": "OperationalCommandResponse", + "code": 4, + "mfgCode": null, + "source": "server", + "isIncoming": 0, + "isEnabled": 1 + } + ], + "attributes": [ + { + "name": "PhaseList", + "code": 0, + "mfgCode": null, + "side": "server", + "type": "array", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CurrentPhase", + "code": 1, + "mfgCode": null, + "side": "server", + "type": "int8u", + "included": 1, + "storageOption": "External", + "singleton": 0, + "bounded": 0, + "defaultValue": null, + "reportable": 1, + "minInterval": 1, + "maxInterval": 65534, + "reportableChange": 0 + }, + { + "name": "CountdownTime", + "code": 2, + "mfgCode": null, + "side": "server", + "type": "elapsed_s", "included": 1, "storageOption": "External", "singleton": 0, @@ -3204,7 +4023,7 @@ "storageOption": "RAM", "singleton": 0, "bounded": 0, - "defaultValue": "1", + "defaultValue": "3", "reportable": 1, "minInterval": 1, "maxInterval": 65534, diff --git a/examples/chef/linux/BUILD.gn b/examples/chef/linux/BUILD.gn index c9c0be1d74156b..238c7b4e2c1570 100644 --- a/examples/chef/linux/BUILD.gn +++ b/examples/chef/linux/BUILD.gn @@ -42,6 +42,8 @@ executable("${sample_name}") { sources = [ "${project_dir}/common/chef-air-quality.cpp", "${project_dir}/common/chef-concentration-measurement.cpp", + "${project_dir}/common/chef-dishwasher-alarm-delegate-impl.cpp", + "${project_dir}/common/chef-dishwasher-mode-delegate-impl.cpp", "${project_dir}/common/chef-fan-control-manager.cpp", "${project_dir}/common/chef-laundry-washer-controls-delegate-impl.cpp", "${project_dir}/common/chef-laundry-washer-mode.cpp", diff --git a/examples/chef/nrfconnect/CMakeLists.txt b/examples/chef/nrfconnect/CMakeLists.txt index 13ddc003e3b878..2f5675cc7fe0e1 100644 --- a/examples/chef/nrfconnect/CMakeLists.txt +++ b/examples/chef/nrfconnect/CMakeLists.txt @@ -83,6 +83,8 @@ target_sources(app PRIVATE ${CHEF}/common/chef-fan-control-manager.cpp ${CHEF}/common/chef-laundry-washer-controls-delegate-impl.cpp ${CHEF}/common/chef-laundry-washer-mode.cpp + ${CHEF}/common/chef-dishwasher-alarm-delegate-impl.cpp + ${CHEF}/common/chef-dishwasher-mode-delegate-impl.cpp ${CHEF}/common/chef-operational-state-delegate-impl.cpp ${CHEF}/common/chef-rvc-mode-delegate.cpp ${CHEF}/common/chef-rvc-operational-state-delegate.cpp From 640f21a3034a3a996d1217b261511959b2c7a5b8 Mon Sep 17 00:00:00 2001 From: Axel Le Bourhis <45206070+axelnxp@users.noreply.github.com> Date: Wed, 18 Sep 2024 15:40:38 +0200 Subject: [PATCH 15/47] [NXP][Zephyr] Add experimental Ethernet support to NXP zephyr platforms (#35643) * [NXP][Zephyr] Add experimental Ethernet support to nxp zephyr platforms * Enable Ethernet for RW61x platform * Add ethernet support in following examples: * All-clusters-app * Laudry washer * Thermostat * Support ethernet build with build_examples.py and add it to workflows Signed-off-by: Axel Le Bourhis * Restyled by gn * [Telink] Define CHIP_DEVICE_CONFIG_ENABLE_ETHERNET as required by shared Zephyr platform Like nrfconnect platform, define CHIP_DEVICE_CONFIG_ENABLE_ETHERNET to 0 as required by share Zephyr platform files. Signed-off-by: Axel Le Bourhis --------- Signed-off-by: Axel Le Bourhis Co-authored-by: Restyled.io --- .github/workflows/examples-nxp.yaml | 5 +- config/nxp/chip-module/CMakeLists.txt | 2 +- config/nxp/chip-module/Kconfig.defaults | 20 ++++- config/nxp/chip-module/Kconfig.features | 23 ++++++ config/nxp/cmake/common.cmake | 1 + .../boards/rd_rw612_bga_ethernet.overlay | 18 +++++ .../boards/rd_rw612_bga_ethernet_fdata.conf | 23 ++++++ .../nxp/zephyr/prj_ethernet.conf | 27 +++++++ .../boards/rd_rw612_bga_ethernet.overlay | 18 +++++ .../boards/rd_rw612_bga_ethernet_fdata.conf | 23 ++++++ .../nxp/zephyr/prj_ethernet.conf | 27 +++++++ .../nxp/common/app_task/include/AppTaskBase.h | 2 + .../common/app_task/include/AppTaskZephyr.h | 2 + .../common/app_task/source/AppTaskBase.cpp | 5 ++ .../common/app_task/source/AppTaskZephyr.cpp | 12 ++- .../boards/rd_rw612_bga_ethernet.overlay | 18 +++++ .../boards/rd_rw612_bga_ethernet_fdata.conf | 23 ++++++ .../thermostat/nxp/zephyr/prj_ethernet.conf | 27 +++++++ scripts/build/build/targets.py | 2 + scripts/build/builders/nxp.py | 15 +++- .../build/testdata/all_targets_linux_x64.txt | 2 +- .../Zephyr/ConfigurationManagerImpl.cpp | 5 ++ src/platform/nxp/zephyr/BUILD.gn | 35 ++++++--- .../nxp/zephyr/ConnectivityManagerImpl.cpp | 7 +- .../nxp/zephyr/ConnectivityManagerImpl.h | 7 ++ .../Ethernet/ConnectivityManagerImplEth.cpp | 38 +++++++++ .../Ethernet/ConnectivityManagerImplEth.h | 35 +++++++++ .../nxp/zephyr/Ethernet/EthManager.cpp | 41 ++++++++++ src/platform/nxp/zephyr/Ethernet/EthManager.h | 40 ++++++++++ .../nxp/zephyr/Ethernet/NxpEthDriver.cpp | 36 +++++++++ .../nxp/zephyr/Ethernet/NxpEthDriver.h | 78 +++++++++++++++++++ src/platform/nxp/zephyr/args.gni | 3 + .../telink/CHIPDevicePlatformConfig.h | 5 ++ 33 files changed, 601 insertions(+), 24 deletions(-) create mode 100644 examples/all-clusters-app/nxp/zephyr/boards/rd_rw612_bga_ethernet.overlay create mode 100644 examples/all-clusters-app/nxp/zephyr/boards/rd_rw612_bga_ethernet_fdata.conf create mode 100644 examples/all-clusters-app/nxp/zephyr/prj_ethernet.conf create mode 100644 examples/laundry-washer-app/nxp/zephyr/boards/rd_rw612_bga_ethernet.overlay create mode 100644 examples/laundry-washer-app/nxp/zephyr/boards/rd_rw612_bga_ethernet_fdata.conf create mode 100644 examples/laundry-washer-app/nxp/zephyr/prj_ethernet.conf create mode 100644 examples/thermostat/nxp/zephyr/boards/rd_rw612_bga_ethernet.overlay create mode 100644 examples/thermostat/nxp/zephyr/boards/rd_rw612_bga_ethernet_fdata.conf create mode 100644 examples/thermostat/nxp/zephyr/prj_ethernet.conf create mode 100644 src/platform/nxp/zephyr/Ethernet/ConnectivityManagerImplEth.cpp create mode 100644 src/platform/nxp/zephyr/Ethernet/ConnectivityManagerImplEth.h create mode 100644 src/platform/nxp/zephyr/Ethernet/EthManager.cpp create mode 100644 src/platform/nxp/zephyr/Ethernet/EthManager.h create mode 100644 src/platform/nxp/zephyr/Ethernet/NxpEthDriver.cpp create mode 100644 src/platform/nxp/zephyr/Ethernet/NxpEthDriver.h diff --git a/.github/workflows/examples-nxp.yaml b/.github/workflows/examples-nxp.yaml index 6fc6970ce2c51d..83506c6c070cb8 100644 --- a/.github/workflows/examples-nxp.yaml +++ b/.github/workflows/examples-nxp.yaml @@ -274,7 +274,7 @@ jobs: with: platform-name: RW61X zephyr: - name: ZEPHYR_RW61X + name: ZEPHYR runs-on: ubuntu-latest if: github.actor != 'restyled-io[bot]' @@ -290,12 +290,13 @@ jobs: with: platform: nxp - - name: Build RW61x Zephyr examples + - name: Build NXP Zephyr examples run: | scripts/run_in_build_env.sh "\ ./scripts/build/build_examples.py \ --target nxp-rw61x-zephyr-all-clusters \ --target nxp-rw61x-zephyr-thermostat \ --target nxp-rw61x-zephyr-laundry-washer-factory \ + --target nxp-rw61x_eth-zephyr-thermostat-ethernet \ build \ " diff --git a/config/nxp/chip-module/CMakeLists.txt b/config/nxp/chip-module/CMakeLists.txt index 557cb6f8766a81..5024672e144e24 100644 --- a/config/nxp/chip-module/CMakeLists.txt +++ b/config/nxp/chip-module/CMakeLists.txt @@ -123,7 +123,7 @@ endif() if (CONFIG_NET_L2_OPENTHREAD) matter_add_gn_arg_string("chip_mdns" "platform") -elseif(CONFIG_WIFI_NXP) +elseif(CONFIG_WIFI_NXP OR CONFIG_CHIP_ETHERNET) matter_add_gn_arg_string("chip_mdns" "minimal") else() matter_add_gn_arg_string("chip_mdns" "none") diff --git a/config/nxp/chip-module/Kconfig.defaults b/config/nxp/chip-module/Kconfig.defaults index ba9fe9b4d3f4ab..3d0fcf08d75eac 100644 --- a/config/nxp/chip-module/Kconfig.defaults +++ b/config/nxp/chip-module/Kconfig.defaults @@ -252,10 +252,6 @@ choice SCHED_ALGORITHM default SCHED_MULTIQ endchoice -choice LIBC_IMPLEMENTATION - default NEWLIB_LIBC -endchoice - choice WIFI_NM_WPA_SUPPLICANT_LOG_LEVEL_CHOICE default WIFI_NM_WPA_SUPPLICANT_LOG_LEVEL_INF endchoice @@ -326,6 +322,22 @@ config CHIP_MALLOC_SYS_HEAP_SIZE endif +if CHIP_ETHERNET || CHIP_WIFI + +choice LIBC_IMPLEMENTATION + default NEWLIB_LIBC +endchoice + +endif + +if CHIP_ETHERNET + +choice NXP_ENET_DRIVER + default ETH_NXP_ENET +endchoice + +endif + # Configure MBEDTLS lib config MBEDTLS default y diff --git a/config/nxp/chip-module/Kconfig.features b/config/nxp/chip-module/Kconfig.features index 4b387464aecab4..9c388a20f9db72 100644 --- a/config/nxp/chip-module/Kconfig.features +++ b/config/nxp/chip-module/Kconfig.features @@ -76,4 +76,27 @@ config CHIP_WIFI_CONNECTION_RECOVERY_JITTER a random jitter interval is added to it to avoid periodicity. The random jitter is selected within range [-JITTER; +JITTER]. +config CHIP_ETHERNET + bool "Enable NXP Ethernet support" + default n + depends on !CHIP_WIFI + select NET_MGMT_EVENT + select NET_MGMT_EVENT_INFO + select NET_L2_ETHERNET + select NET_L2_ETHERNET_MGMT + select NET_UDP + select NET_IP + select NET_CONFIG_SETTINGS + select NET_MGMT + select NET_IPV4 + select NET_DHCPV4 + select NET_NATIVE_IPV4 + select NET_NATIVE + select NET_TCP + select DNS_RESOLVER + select MDNS_RESOLVER + select MBEDTLS_PKCS5_C + select MBEDTLS_HKDF_C + select MBEDTLS_ECDSA_C + select PSA_CRYPTO_ENABLE_ALL endif # CHIP diff --git a/config/nxp/cmake/common.cmake b/config/nxp/cmake/common.cmake index 8b0f379f502d09..df169ef7089343 100644 --- a/config/nxp/cmake/common.cmake +++ b/config/nxp/cmake/common.cmake @@ -44,6 +44,7 @@ matter_add_gn_arg_bool ("chip_detail_logging" CONFIG_MATTER_ matter_add_gn_arg_bool ("chip_automation_logging" FALSE) matter_add_gn_arg_bool ("chip_malloc_sys_heap" CONFIG_CHIP_MALLOC_SYS_HEAP) matter_add_gn_arg_bool ("chip_enable_wifi" CONFIG_CHIP_WIFI) +matter_add_gn_arg_bool ("chip_enable_ethernet" CONFIG_CHIP_ETHERNET) matter_add_gn_arg_bool ("chip_system_config_provide_statistics" CONFIG_CHIP_STATISTICS) matter_add_gn_arg_bool ("chip_enable_icd_server" CONFIG_CHIP_ENABLE_ICD_SUPPORT) matter_add_gn_arg_bool ("enable_eventlist_attribute" TRUE) diff --git a/examples/all-clusters-app/nxp/zephyr/boards/rd_rw612_bga_ethernet.overlay b/examples/all-clusters-app/nxp/zephyr/boards/rd_rw612_bga_ethernet.overlay new file mode 100644 index 00000000000000..49355e8ced5b75 --- /dev/null +++ b/examples/all-clusters-app/nxp/zephyr/boards/rd_rw612_bga_ethernet.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http: //www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "rd_rw612_bga.overlay" diff --git a/examples/all-clusters-app/nxp/zephyr/boards/rd_rw612_bga_ethernet_fdata.conf b/examples/all-clusters-app/nxp/zephyr/boards/rd_rw612_bga_ethernet_fdata.conf new file mode 100644 index 00000000000000..c788aa8569961a --- /dev/null +++ b/examples/all-clusters-app/nxp/zephyr/boards/rd_rw612_bga_ethernet_fdata.conf @@ -0,0 +1,23 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +CONFIG_SETTINGS_NVS_SECTOR_COUNT=16 + +# 0xA226 +CONFIG_CHIP_DEVICE_PRODUCT_ID=41510 +CONFIG_CHIP_DEVICE_PRODUCT_URL="https://www.nxp.com/products/wireless-connectivity/wi-fi-plus-bluetooth-plus-802-15-4/wireless-mcu-with-integrated-tri-radio-1x1-wi-fi-6-plus-bluetooth-low-energy-5-3-802-15-4:RW612" +CONFIG_CHIP_DEVICE_PRODUCT_LABEL="RW612" +CONFIG_CHIP_DEVICE_PART_NUMBER="RW612" diff --git a/examples/all-clusters-app/nxp/zephyr/prj_ethernet.conf b/examples/all-clusters-app/nxp/zephyr/prj_ethernet.conf new file mode 100644 index 00000000000000..4d94d84d91f259 --- /dev/null +++ b/examples/all-clusters-app/nxp/zephyr/prj_ethernet.conf @@ -0,0 +1,27 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Options needed for Ethernet are located in this file + +# ethernet discriminator +CONFIG_CHIP_DEVICE_DISCRIMINATOR=0x700 + +CONFIG_CHIP_WIFI=n +CONFIG_CHIP_ETHERNET=y + +CONFIG_NET_DEFAULT_IF_WIFI=n +CONFIG_BT=n +CONFIG_BT_DEVICE_NAME="" \ No newline at end of file diff --git a/examples/laundry-washer-app/nxp/zephyr/boards/rd_rw612_bga_ethernet.overlay b/examples/laundry-washer-app/nxp/zephyr/boards/rd_rw612_bga_ethernet.overlay new file mode 100644 index 00000000000000..49355e8ced5b75 --- /dev/null +++ b/examples/laundry-washer-app/nxp/zephyr/boards/rd_rw612_bga_ethernet.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http: //www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "rd_rw612_bga.overlay" diff --git a/examples/laundry-washer-app/nxp/zephyr/boards/rd_rw612_bga_ethernet_fdata.conf b/examples/laundry-washer-app/nxp/zephyr/boards/rd_rw612_bga_ethernet_fdata.conf new file mode 100644 index 00000000000000..c788aa8569961a --- /dev/null +++ b/examples/laundry-washer-app/nxp/zephyr/boards/rd_rw612_bga_ethernet_fdata.conf @@ -0,0 +1,23 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +CONFIG_SETTINGS_NVS_SECTOR_COUNT=16 + +# 0xA226 +CONFIG_CHIP_DEVICE_PRODUCT_ID=41510 +CONFIG_CHIP_DEVICE_PRODUCT_URL="https://www.nxp.com/products/wireless-connectivity/wi-fi-plus-bluetooth-plus-802-15-4/wireless-mcu-with-integrated-tri-radio-1x1-wi-fi-6-plus-bluetooth-low-energy-5-3-802-15-4:RW612" +CONFIG_CHIP_DEVICE_PRODUCT_LABEL="RW612" +CONFIG_CHIP_DEVICE_PART_NUMBER="RW612" diff --git a/examples/laundry-washer-app/nxp/zephyr/prj_ethernet.conf b/examples/laundry-washer-app/nxp/zephyr/prj_ethernet.conf new file mode 100644 index 00000000000000..0a1e798ca8425a --- /dev/null +++ b/examples/laundry-washer-app/nxp/zephyr/prj_ethernet.conf @@ -0,0 +1,27 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Options needed for Ethernet are located in this file + +# ethernet discriminator +CONFIG_CHIP_DEVICE_DISCRIMINATOR=0x700 + +CONFIG_CHIP_WIFI=n +CONFIG_CHIP_ETHERNET=y + +CONFIG_NET_DEFAULT_IF_WIFI=n +CONFIG_BT=n +CONFIG_BT_DEVICE_NAME="" diff --git a/examples/platform/nxp/common/app_task/include/AppTaskBase.h b/examples/platform/nxp/common/app_task/include/AppTaskBase.h index b9348eff3f7e69..38770fa0e5ec26 100644 --- a/examples/platform/nxp/common/app_task/include/AppTaskBase.h +++ b/examples/platform/nxp/common/app_task/include/AppTaskBase.h @@ -149,6 +149,8 @@ class AppTaskBase */ #if CONFIG_CHIP_WIFI || CHIP_DEVICE_CONFIG_ENABLE_WPA virtual chip::DeviceLayer::NetworkCommissioning::WiFiDriver * GetWifiDriverInstance(void) = 0; +#elif CONFIG_CHIP_ETHERNET + virtual chip::DeviceLayer::NetworkCommissioning::EthernetDriver * GetEthernetDriverInstance(void) = 0; #endif /** diff --git a/examples/platform/nxp/common/app_task/include/AppTaskZephyr.h b/examples/platform/nxp/common/app_task/include/AppTaskZephyr.h index 9a333a768e1f93..76ceb6db0b3145 100644 --- a/examples/platform/nxp/common/app_task/include/AppTaskZephyr.h +++ b/examples/platform/nxp/common/app_task/include/AppTaskZephyr.h @@ -51,6 +51,8 @@ class AppTaskZephyr : public AppTaskBase */ #if defined(CONFIG_CHIP_WIFI) virtual chip::DeviceLayer::NetworkCommissioning::WiFiDriver * GetWifiDriverInstance(void) override; +#elif defined(CONFIG_CHIP_ETHERNET) + virtual chip::DeviceLayer::NetworkCommissioning::EthernetDriver * GetEthernetDriverInstance(void) override; #endif /** diff --git a/examples/platform/nxp/common/app_task/source/AppTaskBase.cpp b/examples/platform/nxp/common/app_task/source/AppTaskBase.cpp index 10422121e5c81f..c62be98d22c9b1 100644 --- a/examples/platform/nxp/common/app_task/source/AppTaskBase.cpp +++ b/examples/platform/nxp/common/app_task/source/AppTaskBase.cpp @@ -115,6 +115,9 @@ chip::DeviceLayer::DeviceInfoProviderImpl gExampleDeviceInfoProvider; #if CONFIG_CHIP_WIFI || CHIP_DEVICE_CONFIG_ENABLE_WPA app::Clusters::NetworkCommissioning::Instance sNetworkCommissioningInstance(0, chip::NXP::App::GetAppTask().GetWifiDriverInstance()); +#elif CONFIG_CHIP_ETHERNET +app::Clusters::NetworkCommissioning::Instance + sNetworkCommissioningInstance(0, chip::NXP::App::GetAppTask().GetEthernetDriverInstance()); #endif #if CHIP_CONFIG_ENABLE_ICD_SERVER || (CONFIG_CHIP_TEST_EVENT && CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR) @@ -288,6 +291,8 @@ CHIP_ERROR chip::NXP::App::AppTaskBase::Init() #ifdef ENABLE_CHIP_SHELL Shell::SetWiFiDriver(chip::NXP::App::GetAppTask().GetWifiDriverInstance()); #endif +#elif CONFIG_CHIP_ETHERNET + sNetworkCommissioningInstance.Init(); #endif #if CHIP_DEVICE_CONFIG_ENABLE_OTA_REQUESTOR if (err == CHIP_NO_ERROR) diff --git a/examples/platform/nxp/common/app_task/source/AppTaskZephyr.cpp b/examples/platform/nxp/common/app_task/source/AppTaskZephyr.cpp index 00554d8ee1a48c..d5fefcc133caa3 100644 --- a/examples/platform/nxp/common/app_task/source/AppTaskZephyr.cpp +++ b/examples/platform/nxp/common/app_task/source/AppTaskZephyr.cpp @@ -36,6 +36,10 @@ #include "AppCLIBase.h" #endif +#ifdef CONFIG_CHIP_ETHERNET +#include +#endif + #if CONFIG_CHIP_FACTORY_DATA #include #else @@ -69,7 +73,13 @@ chip::DeviceLayer::NetworkCommissioning::WiFiDriver * chip::NXP::App::AppTaskZep return static_cast( &(NetworkCommissioning::ZephyrWifiDriver::Instance())); } -#endif // CONFIG_CHIP_WIFI +#elif defined(CONFIG_CHIP_ETHERNET) +chip::DeviceLayer::NetworkCommissioning::EthernetDriver * chip::NXP::App::AppTaskZephyr::GetEthernetDriverInstance() +{ + return static_cast( + &(NetworkCommissioning::NxpEthDriver::Instance())); +} +#endif CHIP_ERROR chip::NXP::App::AppTaskZephyr::AppMatter_Register() { diff --git a/examples/thermostat/nxp/zephyr/boards/rd_rw612_bga_ethernet.overlay b/examples/thermostat/nxp/zephyr/boards/rd_rw612_bga_ethernet.overlay new file mode 100644 index 00000000000000..49355e8ced5b75 --- /dev/null +++ b/examples/thermostat/nxp/zephyr/boards/rd_rw612_bga_ethernet.overlay @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http: //www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "rd_rw612_bga.overlay" diff --git a/examples/thermostat/nxp/zephyr/boards/rd_rw612_bga_ethernet_fdata.conf b/examples/thermostat/nxp/zephyr/boards/rd_rw612_bga_ethernet_fdata.conf new file mode 100644 index 00000000000000..c788aa8569961a --- /dev/null +++ b/examples/thermostat/nxp/zephyr/boards/rd_rw612_bga_ethernet_fdata.conf @@ -0,0 +1,23 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +CONFIG_SETTINGS_NVS_SECTOR_COUNT=16 + +# 0xA226 +CONFIG_CHIP_DEVICE_PRODUCT_ID=41510 +CONFIG_CHIP_DEVICE_PRODUCT_URL="https://www.nxp.com/products/wireless-connectivity/wi-fi-plus-bluetooth-plus-802-15-4/wireless-mcu-with-integrated-tri-radio-1x1-wi-fi-6-plus-bluetooth-low-energy-5-3-802-15-4:RW612" +CONFIG_CHIP_DEVICE_PRODUCT_LABEL="RW612" +CONFIG_CHIP_DEVICE_PART_NUMBER="RW612" diff --git a/examples/thermostat/nxp/zephyr/prj_ethernet.conf b/examples/thermostat/nxp/zephyr/prj_ethernet.conf new file mode 100644 index 00000000000000..0a1e798ca8425a --- /dev/null +++ b/examples/thermostat/nxp/zephyr/prj_ethernet.conf @@ -0,0 +1,27 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# Options needed for Ethernet are located in this file + +# ethernet discriminator +CONFIG_CHIP_DEVICE_DISCRIMINATOR=0x700 + +CONFIG_CHIP_WIFI=n +CONFIG_CHIP_ETHERNET=y + +CONFIG_NET_DEFAULT_IF_WIFI=n +CONFIG_BT=n +CONFIG_BT_DEVICE_NAME="" diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index 0464c51f7b0e6b..a6e386ff4949c4 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -515,6 +515,7 @@ def BuildNxpTarget(): TargetPart('k32w0', board=NxpBoard.K32W0), TargetPart('k32w1', board=NxpBoard.K32W1), TargetPart('rw61x', board=NxpBoard.RW61X), + TargetPart('rw61x_eth', board=NxpBoard.RW61X_ETH), TargetPart('mcxw71', board=NxpBoard.MCXW71) ]) @@ -544,6 +545,7 @@ def BuildNxpTarget(): target.AppendModifier(name="sw-v2", has_sw_version_2=True) target.AppendModifier(name="ota", enable_ota=True).ExceptIfRe('zephyr') target.AppendModifier(name="wifi", enable_wifi=True).OnlyIfRe('rw61x') + target.AppendModifier(name="ethernet", enable_ethernet=True).OnlyIfRe('rw61x_eth-zephyr') target.AppendModifier(name="thread", enable_thread=True).ExceptIfRe('zephyr') target.AppendModifier(name="matter-shell", enable_shell=True).ExceptIfRe('k32w0|k32w1') target.AppendModifier('data-model-disabled', data_model_interface="disabled").ExceptIfRe('-data-model-enabled') diff --git a/scripts/build/builders/nxp.py b/scripts/build/builders/nxp.py index cdf06ac8b244da..7ab73633a4aed8 100644 --- a/scripts/build/builders/nxp.py +++ b/scripts/build/builders/nxp.py @@ -39,6 +39,7 @@ class NxpBoard(Enum): K32W0 = auto() K32W1 = auto() RW61X = auto() + RW61X_ETH = auto() MCXW71 = auto() def Name(self, os_env): @@ -46,9 +47,12 @@ def Name(self, os_env): return 'k32w0x' elif self == NxpBoard.K32W1: return 'k32w1' - elif self == NxpBoard.RW61X: + elif (self == NxpBoard.RW61X) or (self == NxpBoard.RW61X_ETH): if os_env == NxpOsUsed.ZEPHYR: - return 'rd_rw612_bga' + if self == NxpBoard.RW61X_ETH: + return 'rd_rw612_bga/rw612/ethernet' + else: + return 'rd_rw612_bga' else: return 'rw61x' elif self == NxpBoard.MCXW71: @@ -61,7 +65,7 @@ def FolderName(self, os_env): return 'k32w0' elif self == NxpBoard.K32W1: return 'k32w1' - elif self == NxpBoard.RW61X: + elif (self == NxpBoard.RW61X) or (self == NxpBoard.RW61X_ETH): if os_env == NxpOsUsed.ZEPHYR: return 'zephyr' else: @@ -135,6 +139,7 @@ def __init__(self, disable_ble: bool = False, enable_thread: bool = False, enable_wifi: bool = False, + enable_ethernet: bool = False, disable_ipv4: bool = False, enable_shell: bool = False, enable_ota: bool = False, @@ -159,6 +164,7 @@ def __init__(self, self.disable_ble = disable_ble self.enable_thread = enable_thread self.enable_wifi = enable_wifi + self.enable_ethernet = enable_ethernet self.enable_ota = enable_ota self.enable_shell = enable_shell self.data_model_interface = data_model_interface @@ -221,6 +227,9 @@ def WestBuildArgs(self): if self.enable_factory_data: args.append('-DFILE_SUFFIX=fdata') + if self.enable_ethernet: + args.append('-DEXTRA_CONF_FILE="prj_ethernet.conf"') + if self.has_sw_version_2: args.append('-DCONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2') diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index dbbf90508b0245..a5a28f3fc28986 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -13,7 +13,7 @@ linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,therm linux-x64-efr32-test-runner[-clang] imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release] infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage][-trustm] -nxp-{k32w0,k32w1,rw61x,mcxw71}-{zephyr,freertos}-{lighting,contact-sensor,lock-app,all-clusters,laundry-washer,thermostat}[-factory][-low-power][-lit][-fro32k][-smu2][-dac-conversion][-rotating-id][-sw-v2][-ota][-wifi][-thread][-matter-shell][-data-model-disabled][-data-model-enabled] +nxp-{k32w0,k32w1,rw61x,rw61x_eth,mcxw71}-{zephyr,freertos}-{lighting,contact-sensor,lock-app,all-clusters,laundry-washer,thermostat}[-factory][-low-power][-lit][-fro32k][-smu2][-dac-conversion][-rotating-id][-sw-v2][-ota][-wifi][-ethernet][-thread][-matter-shell][-data-model-disabled][-data-model-enabled] mbed-cy8cproto_062_4343w-{lock,light,all-clusters,all-clusters-minimal,pigweed,ota-requestor,shell}[-release][-develop][-debug][-data-model-disabled][-data-model-enabled] mw320-all-clusters-app nrf-{nrf5340dk,nrf52840dk,nrf52840dongle}-{all-clusters,all-clusters-minimal,lock,light,light-switch,shell,pump,pump-controller,window-covering}[-rpc][-data-model-disabled][-data-model-enabled] diff --git a/src/platform/Zephyr/ConfigurationManagerImpl.cpp b/src/platform/Zephyr/ConfigurationManagerImpl.cpp index 2b1070af88ee77..b582f4a3180a97 100644 --- a/src/platform/Zephyr/ConfigurationManagerImpl.cpp +++ b/src/platform/Zephyr/ConfigurationManagerImpl.cpp @@ -227,8 +227,13 @@ void ConfigurationManagerImpl::DoFactoryReset(intptr_t arg) CHIP_ERROR ConfigurationManagerImpl::GetPrimaryWiFiMACAddress(uint8_t * buf) { +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI || CHIP_DEVICE_CONFIG_ENABLE_ETHERNET #if CHIP_DEVICE_CONFIG_ENABLE_WIFI const net_if * const iface = InetUtils::GetWiFiInterface(); +#else + const net_if * const iface = InetUtils::GetInterface(); +#endif + VerifyOrReturnError(iface != nullptr, CHIP_ERROR_INTERNAL); const auto linkAddrStruct = iface->if_dev->link_addr; diff --git a/src/platform/nxp/zephyr/BUILD.gn b/src/platform/nxp/zephyr/BUILD.gn index 91a746e1e4b41f..b00af4edb598de 100644 --- a/src/platform/nxp/zephyr/BUILD.gn +++ b/src/platform/nxp/zephyr/BUILD.gn @@ -23,9 +23,6 @@ static_library("nxp_zephyr") { defines = [] sources = [ "../../SingletonConfigurationManager.cpp", - "../../Zephyr/BLEAdvertisingArbiter.cpp", - "../../Zephyr/BLEAdvertisingArbiter.h", - "../../Zephyr/BLEManagerImpl.cpp", "../../Zephyr/ConfigurationManagerImpl.cpp", "../../Zephyr/DiagnosticDataProviderImpl.cpp", "../../Zephyr/DiagnosticDataProviderImpl.h", @@ -37,8 +34,6 @@ static_library("nxp_zephyr") { "../../Zephyr/ZephyrConfig.h", "../common/CHIPDeviceNXPPlatformDefaultConfig.h", "../common/CHIPNXPPlatformDefaultConfig.h", - "BLEManagerImpl.h", - "BlePlatformConfig.h", "CHIPDevicePlatformConfig.h", "CHIPDevicePlatformEvent.h", "CHIPPlatformConfig.h", @@ -81,11 +76,17 @@ static_library("nxp_zephyr") { "DeviceInstanceInfoProviderImpl.h", ] } - + if (chip_config_network_layer_ble) { + sources += [ + "../../Zephyr/BLEAdvertisingArbiter.cpp", + "../../Zephyr/BLEAdvertisingArbiter.h", + "../../Zephyr/BLEManagerImpl.cpp", + "BLEManagerImpl.h", + "BlePlatformConfig.h", + ] + } if (chip_enable_wifi) { sources += [ - "../../Zephyr/InetUtils.cpp", - "../../Zephyr/InetUtils.h", "../../Zephyr/wifi/ConnectivityManagerImplWiFi.cpp", "../../Zephyr/wifi/ConnectivityManagerImplWiFi.h", "../../Zephyr/wifi/WiFiManager.cpp", @@ -94,14 +95,28 @@ static_library("nxp_zephyr") { "../../Zephyr/wifi/ZephyrWifiDriver.h", ] } - + if (chip_enable_ethernet) { + sources += [ + "Ethernet/ConnectivityManagerImplEth.cpp", + "Ethernet/ConnectivityManagerImplEth.h", + "Ethernet/EthManager.cpp", + "Ethernet/EthManager.h", + "Ethernet/NxpEthDriver.cpp", + "Ethernet/NxpEthDriver.h", + ] + } if (chip_enable_ota_requestor) { sources += [ "ota/OTAImageProcessorImpl.cpp", "ota/OTAImageProcessorImpl.h", ] } - + if (chip_enable_wifi || chip_enable_ethernet) { + sources += [ + "../../Zephyr/InetUtils.cpp", + "../../Zephyr/InetUtils.h", + ] + } if (chip_malloc_sys_heap) { sources += [ "../../Zephyr/SysHeapMalloc.cpp" ] } diff --git a/src/platform/nxp/zephyr/ConnectivityManagerImpl.cpp b/src/platform/nxp/zephyr/ConnectivityManagerImpl.cpp index 4d183558c18953..33cdbcd9e47d19 100644 --- a/src/platform/nxp/zephyr/ConnectivityManagerImpl.cpp +++ b/src/platform/nxp/zephyr/ConnectivityManagerImpl.cpp @@ -69,7 +69,7 @@ CHIP_ERROR JoinLeaveMulticastGroup(net_if * iface, const Inet::IPAddress & addre } #endif -#if CHIP_DEVICE_CONFIG_ENABLE_WIFI +#if CHIP_DEVICE_CONFIG_ENABLE_WIFI || CHIP_DEVICE_CONFIG_ENABLE_ETHERNET // The following code should also be valid for other interface types, such as Ethernet, // but they are not officially supported, so for now enable it for Wi-Fi only. const in6_addr in6Addr = InetUtils::ToZephyrAddr(address); @@ -104,11 +104,14 @@ CHIP_ERROR ConnectivityManagerImpl::_Init() #if CHIP_DEVICE_CONFIG_ENABLE_THREAD GenericConnectivityManagerImpl_Thread::_Init(); #endif + #if CHIP_DEVICE_CONFIG_ENABLE_WIFI ReturnErrorOnFailure(InitWiFi()); +#elif CHIP_DEVICE_CONFIG_ENABLE_ETHERNET + ReturnErrorOnFailure(InitEth()); #endif -#if CHIP_DEVICE_CONFIG_ENABLE_THREAD || CHIP_DEVICE_CONFIG_ENABLE_WIFI +#if CHIP_DEVICE_CONFIG_ENABLE_THREAD || CHIP_DEVICE_CONFIG_ENABLE_WIFI || CHIP_DEVICE_CONFIG_ENABLE_ETHERNET UDPEndPointImplSockets::SetMulticastGroupHandler( [](InterfaceId interfaceId, const IPAddress & address, UDPEndPointImplSockets::MulticastOperation operation) { if (interfaceId.IsPresent()) diff --git a/src/platform/nxp/zephyr/ConnectivityManagerImpl.h b/src/platform/nxp/zephyr/ConnectivityManagerImpl.h index c43d6a35dcb841..96c0fe303d315e 100644 --- a/src/platform/nxp/zephyr/ConnectivityManagerImpl.h +++ b/src/platform/nxp/zephyr/ConnectivityManagerImpl.h @@ -41,6 +41,10 @@ #include #endif +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET +#include "Ethernet/ConnectivityManagerImplEth.h" +#endif + #include namespace chip { @@ -71,6 +75,9 @@ class ConnectivityManagerImpl final : public ConnectivityManager, #else public Internal::GenericConnectivityManagerImpl_NoThread, #endif +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET + public ConnectivityManagerImplEth, +#endif #if CHIP_DEVICE_CONFIG_ENABLE_WIFI public ConnectivityManagerImplWiFi #else diff --git a/src/platform/nxp/zephyr/Ethernet/ConnectivityManagerImplEth.cpp b/src/platform/nxp/zephyr/Ethernet/ConnectivityManagerImplEth.cpp new file mode 100644 index 00000000000000..566c1c7c186af3 --- /dev/null +++ b/src/platform/nxp/zephyr/Ethernet/ConnectivityManagerImplEth.cpp @@ -0,0 +1,38 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "EthManager.h" + +#include +#include +#include + +#include "ConnectivityManagerImplEth.h" + +#if CHIP_DEVICE_CONFIG_ENABLE_ETHERNET +using namespace ::chip; +namespace chip { +namespace DeviceLayer { +CHIP_ERROR ConnectivityManagerImplEth::InitEth() +{ + return EthManager::Instance().Init(); +} +} // namespace DeviceLayer +} // namespace chip + +#endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET diff --git a/src/platform/nxp/zephyr/Ethernet/ConnectivityManagerImplEth.h b/src/platform/nxp/zephyr/Ethernet/ConnectivityManagerImplEth.h new file mode 100644 index 00000000000000..b2f7a7d450883a --- /dev/null +++ b/src/platform/nxp/zephyr/Ethernet/ConnectivityManagerImplEth.h @@ -0,0 +1,35 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include + +namespace chip { +namespace DeviceLayer { +class ConnectivityManagerImplEth +{ + friend class ConnectivityManager; + friend class EthManager; + +protected: + CHIP_ERROR InitEth(); +}; +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/nxp/zephyr/Ethernet/EthManager.cpp b/src/platform/nxp/zephyr/Ethernet/EthManager.cpp new file mode 100644 index 00000000000000..1d40654dfb79fd --- /dev/null +++ b/src/platform/nxp/zephyr/Ethernet/EthManager.cpp @@ -0,0 +1,41 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * Copyright 2024 NXP + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "EthManager.h" + +#include +#include + +#include + +#include +#include + +#include + +namespace chip { +namespace DeviceLayer { + +CHIP_ERROR EthManager::Init() +{ + ChipLogDetail(DeviceLayer, "EthManager has been initialized"); + return CHIP_NO_ERROR; +} +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/nxp/zephyr/Ethernet/EthManager.h b/src/platform/nxp/zephyr/Ethernet/EthManager.h new file mode 100644 index 00000000000000..591dbb7ac5b3f1 --- /dev/null +++ b/src/platform/nxp/zephyr/Ethernet/EthManager.h @@ -0,0 +1,40 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * Copyright 2024 NXP + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +namespace chip { +namespace DeviceLayer { +class EthManager +{ +public: + static EthManager & Instance() + { + static EthManager sInstance; + return sInstance; + } + CHIP_ERROR Init(); +}; + +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/nxp/zephyr/Ethernet/NxpEthDriver.cpp b/src/platform/nxp/zephyr/Ethernet/NxpEthDriver.cpp new file mode 100644 index 00000000000000..341c4daab97725 --- /dev/null +++ b/src/platform/nxp/zephyr/Ethernet/NxpEthDriver.cpp @@ -0,0 +1,36 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "NxpEthDriver.h" + +#include +#include + +using namespace ::chip; +namespace chip { +namespace DeviceLayer { +namespace NetworkCommissioning { + +CHIP_ERROR NxpEthDriver::Init(NetworkStatusChangeCallback * networkStatusChangeCallback) +{ + return CHIP_NO_ERROR; +} + +} // namespace NetworkCommissioning +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/nxp/zephyr/Ethernet/NxpEthDriver.h b/src/platform/nxp/zephyr/Ethernet/NxpEthDriver.h new file mode 100644 index 00000000000000..3a115a69ba4317 --- /dev/null +++ b/src/platform/nxp/zephyr/Ethernet/NxpEthDriver.h @@ -0,0 +1,78 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * Copyright 2024 NXP + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include "EthManager.h" + +#include + +namespace chip { +namespace DeviceLayer { +namespace NetworkCommissioning { +class NxpEthDriver final : public EthernetDriver +{ +public: + class EthernetNetworkIterator final : public NetworkIterator + { + public: + EthernetNetworkIterator(NxpEthDriver * aDriver) : mDriver(aDriver) {} + size_t Count() { return 1; } + bool Next(Network & item) override + { + if (exhausted) + { + return false; + } + exhausted = true; + memcpy(item.networkID, interfaceName, interfaceNameLen); + item.networkIDLen = interfaceNameLen; + item.connected = true; + return true; + } + void Release() override { delete this; } + ~EthernetNetworkIterator() = default; + + uint8_t interfaceName[kMaxNetworkIDLen]; + uint8_t interfaceNameLen = 0; + bool exhausted = false; + + private: + NxpEthDriver * mDriver; + }; + + // BaseDriver + NetworkIterator * GetNetworks() override { return new EthernetNetworkIterator(this); }; + uint8_t GetMaxNetworks() { return 1; } + CHIP_ERROR Init(NetworkStatusChangeCallback * networkStatusChangeCallback) override; + void Shutdown() + { + // TODO: This method can be implemented if Ethernet is used along with Wifi/Thread. + } + + static NxpEthDriver & Instance() + { + static NxpEthDriver instance; + return instance; + } +}; + +} // namespace NetworkCommissioning +} // namespace DeviceLayer +} // namespace chip diff --git a/src/platform/nxp/zephyr/args.gni b/src/platform/nxp/zephyr/args.gni index e24f997ccdf64b..449cfe190020b2 100644 --- a/src/platform/nxp/zephyr/args.gni +++ b/src/platform/nxp/zephyr/args.gni @@ -17,4 +17,7 @@ declare_args() { # Enable factory data support chip_enable_factory_data = false + + # Enable Ethernet support + chip_enable_ethernet = false } diff --git a/src/platform/telink/CHIPDevicePlatformConfig.h b/src/platform/telink/CHIPDevicePlatformConfig.h index cc612b86499eba..989b9b2aaf3705 100644 --- a/src/platform/telink/CHIPDevicePlatformConfig.h +++ b/src/platform/telink/CHIPDevicePlatformConfig.h @@ -103,6 +103,11 @@ #define CHIP_DEVICE_CONFIG_ENABLE_WIFI_AP 0 #endif +// telink platform does not support ethernet yet, but we need this config defined as we share the Zephyr platform +#ifndef CHIP_DEVICE_CONFIG_ENABLE_ETHERNET +#define CHIP_DEVICE_CONFIG_ENABLE_ETHERNET 0 +#endif // CHIP_DEVICE_CONFIG_ENABLE_ETHERNET + #ifdef CONFIG_BT #define CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE CONFIG_BT #else From 317f1a94d261242627859bc4ccddbb0c8e3c087c Mon Sep 17 00:00:00 2001 From: Marius Tache <102153746+marius-alex-tache@users.noreply.github.com> Date: Wed, 18 Sep 2024 18:17:06 +0300 Subject: [PATCH 16/47] [NXP] Add multiple ble connections support (#35645) * [nxp][examples][platform][common] Add BLEApplicationManager interface and empty implementation Signed-off-by: Andrei Menzopol * [nxp][platform][common][ble] Add BLEManagerCommon multiple connections changes * Make gatt attribute read/write handles generic * Update mServiceMode to support multiple ble connections * Create mDeviceIds set * Update flow to handle multiple ble connections Signed-off-by: Andrei Menzopol * [nxp][examples][mcxw71_k32w1] Multiple ble connections changes * Add button handle to enable multiple ble connections (start advertisement) * Add app_ble/BLEApplicationManager.* to handle check & start advertisement Signed-off-by: Andrei Menzopol * [nxp][examples][common][lock-app] Add call to BLEApplicationManager Init Signed-off-by: Andrei Menzopol * [nxp][examples][mcxw71] Multiple ble connections changes * lock-app: * Add extra gatt headers to include demo gatt service * Add build changes * Update readme * other apps: * Add BLEApplicationManagerEmpty Signed-off-by: Andrei Menzopol * [nxp][examples][k32w1] Multiple ble connections changes * lock-app: * Add extra gatt headers to include demo gatt service * Add build changes * Update readme * other apps: * Add BLEApplicationManagerEmpty Signed-off-by: Andrei Menzopol * Restyled by clang-format * Restyled by gn * [nxp][examples][mcxw71][lock-app] Multiple ble connections changes * Add extra gatt headers to include demo gatt service * Add build changes * Update readme Signed-off-by: Andrei Menzopol * [nxp][examples][k32w1][lock-app] Multiple ble connections changes * Add extra gatt headers to include demo gatt service * Add build changes * Update readme Signed-off-by: Andrei Menzopol * Restyled by gn * Restyled by prettier-markdown --------- Signed-off-by: Andrei Menzopol Co-authored-by: Andrei Menzopol Co-authored-by: Restyled.io --- .../contact-sensor-app/nxp/k32w1/BUILD.gn | 2 + .../contact-sensor-app/nxp/mcxw71/BUILD.gn | 2 + examples/lighting-app/nxp/k32w1/BUILD.gn | 2 + examples/lighting-app/nxp/mcxw71/BUILD.gn | 2 + examples/lock-app/nxp/common/main/AppTask.cpp | 4 + examples/lock-app/nxp/k32w1/BUILD.gn | 18 ++++ examples/lock-app/nxp/k32w1/README.md | 13 +++ examples/lock-app/nxp/mcxw71/BUILD.gn | 18 ++++ examples/lock-app/nxp/mcxw71/README.md | 13 +++ .../app_ble/include/BLEApplicationManager.h | 49 ++++++++++ .../source/BLEApplicationManagerEmpty.cpp | 39 ++++++++ .../app_ble/include/extra_gatt_db.h | 4 + .../app_ble/include/extra_gatt_uuid128.h | 23 +++++ .../app_ble/source/BLEApplicationManager.cpp | 94 +++++++++++++++++++ .../nxp/mcxw71_k32w1/button/ButtonManager.cpp | 3 + .../nxp/common/ble/BLEManagerCommon.cpp | 80 +++++++++++----- .../nxp/common/ble/BLEManagerCommon.h | 38 ++++++-- 17 files changed, 373 insertions(+), 31 deletions(-) create mode 100644 examples/platform/nxp/common/app_ble/include/BLEApplicationManager.h create mode 100644 examples/platform/nxp/common/app_ble/source/BLEApplicationManagerEmpty.cpp create mode 100644 examples/platform/nxp/mcxw71_k32w1/app_ble/include/extra_gatt_db.h create mode 100644 examples/platform/nxp/mcxw71_k32w1/app_ble/include/extra_gatt_uuid128.h create mode 100644 examples/platform/nxp/mcxw71_k32w1/app_ble/source/BLEApplicationManager.cpp diff --git a/examples/contact-sensor-app/nxp/k32w1/BUILD.gn b/examples/contact-sensor-app/nxp/k32w1/BUILD.gn index e887b2c5cc4f7f..8e215d4c7d6517 100644 --- a/examples/contact-sensor-app/nxp/k32w1/BUILD.gn +++ b/examples/contact-sensor-app/nxp/k32w1/BUILD.gn @@ -139,9 +139,11 @@ mcxw71_k32w1_executable("contact_sensor_app") { "${common_example_dir}/low_power/include", "${common_example_dir}/operational_keystore/include", "${common_example_dir}/ui_feedback/include", + "${common_example_dir}/app_ble/include", ] sources += [ + "${common_example_dir}/app_ble/source/BLEApplicationManagerEmpty.cpp", "${common_example_dir}/app_task/source/AppTaskBase.cpp", "${common_example_dir}/app_task/source/AppTaskFreeRTOS.cpp", "${common_example_dir}/clusters/source/ZclCallbacks.cpp", diff --git a/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn b/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn index 87b25125d1c47c..cf22ec5c658509 100644 --- a/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn +++ b/examples/contact-sensor-app/nxp/mcxw71/BUILD.gn @@ -138,9 +138,11 @@ mcxw71_k32w1_executable("contact_sensor_app") { "${common_example_dir}/low_power/include", "${common_example_dir}/operational_keystore/include", "${common_example_dir}/ui_feedback/include", + "${common_example_dir}/app_ble/include", ] sources += [ + "${common_example_dir}/app_ble/source/BLEApplicationManagerEmpty.cpp", "${common_example_dir}/app_task/source/AppTaskBase.cpp", "${common_example_dir}/app_task/source/AppTaskFreeRTOS.cpp", "${common_example_dir}/clusters/source/ZclCallbacks.cpp", diff --git a/examples/lighting-app/nxp/k32w1/BUILD.gn b/examples/lighting-app/nxp/k32w1/BUILD.gn index 8b5bd6b2cd77f2..54030a789763ea 100644 --- a/examples/lighting-app/nxp/k32w1/BUILD.gn +++ b/examples/lighting-app/nxp/k32w1/BUILD.gn @@ -146,9 +146,11 @@ mcxw71_k32w1_executable("light_app") { "${common_example_dir}/operational_keystore/include", "${common_example_dir}/rpc/include", "${common_example_dir}/ui_feedback/include", + "${common_example_dir}/app_ble/include", ] sources += [ + "${common_example_dir}/app_ble/source/BLEApplicationManagerEmpty.cpp", "${common_example_dir}/app_task/source/AppTaskBase.cpp", "${common_example_dir}/app_task/source/AppTaskFreeRTOS.cpp", "${common_example_dir}/clusters/source/ZclCallbacks.cpp", diff --git a/examples/lighting-app/nxp/mcxw71/BUILD.gn b/examples/lighting-app/nxp/mcxw71/BUILD.gn index b5d393dc6b9afc..efd3af6fd5e19a 100644 --- a/examples/lighting-app/nxp/mcxw71/BUILD.gn +++ b/examples/lighting-app/nxp/mcxw71/BUILD.gn @@ -146,9 +146,11 @@ mcxw71_k32w1_executable("light_app") { "${common_example_dir}/operational_keystore/include", "${common_example_dir}/rpc/include", "${common_example_dir}/ui_feedback/include", + "${common_example_dir}/app_ble/include", ] sources += [ + "${common_example_dir}/app_ble/source/BLEApplicationManagerEmpty.cpp", "${common_example_dir}/app_task/source/AppTaskBase.cpp", "${common_example_dir}/app_task/source/AppTaskFreeRTOS.cpp", "${common_example_dir}/clusters/source/ZclCallbacks.cpp", diff --git a/examples/lock-app/nxp/common/main/AppTask.cpp b/examples/lock-app/nxp/common/main/AppTask.cpp index 26a385ec0b2c97..d2a983e68d32ad 100644 --- a/examples/lock-app/nxp/common/main/AppTask.cpp +++ b/examples/lock-app/nxp/common/main/AppTask.cpp @@ -19,6 +19,7 @@ */ #include "AppTask.h" +#include "BLEApplicationManager.h" #include "CHIPDeviceManager.h" #include "LockManager.h" #include @@ -115,6 +116,9 @@ static CHIP_ERROR cliDoorLock(int argc, char * argv[]) void LockApp::AppTask::PreInitMatterStack() { ChipLogProgress(DeviceLayer, "Welcome to NXP Lock Demo App"); + + /* BLEApplicationManager implemented per platform or left blank */ + chip::NXP::App::BleAppMgr().Init(); } void LockApp::AppTask::PostInitMatterStack() diff --git a/examples/lock-app/nxp/k32w1/BUILD.gn b/examples/lock-app/nxp/k32w1/BUILD.gn index 42cff8a8b42c45..602398e0d604b4 100644 --- a/examples/lock-app/nxp/k32w1/BUILD.gn +++ b/examples/lock-app/nxp/k32w1/BUILD.gn @@ -92,6 +92,14 @@ mcxw71_k32w1_sdk("sdk") { "${example_platform_dir}/board/peripherals.h", ] } + + if (nxp_multiple_ble_connections) { + include_dirs += [ "${example_platform_dir}/app_ble/include" ] + defines += [ + "EXTRA_GATT_DB_HEADER=\"extra_gatt_db.h\"", + "EXTRA_GATT_UUID_HEADER=\"extra_gatt_uuid128.h\"", + ] + } } mcxw71_k32w1_executable("lock_app") { @@ -140,6 +148,7 @@ mcxw71_k32w1_executable("lock_app") { "${common_example_dir}/low_power/include", "${common_example_dir}/operational_keystore/include", "${common_example_dir}/ui_feedback/include", + "${common_example_dir}/app_ble/include", ] sources += [ @@ -189,6 +198,15 @@ mcxw71_k32w1_executable("lock_app") { deps += [ "${chip_root}/src/platform/nxp:nxp_ota" ] } + if (nxp_multiple_ble_connections) { + sources += + [ "${example_platform_dir}/app_ble/source/BLEApplicationManager.cpp" ] + } else { + sources += [ + "${common_example_dir}/app_ble/source/BLEApplicationManagerEmpty.cpp", + ] + } + if (chip_with_diag_logs_demo) { sources += [ "${common_example_dir}/diagnostic_logs/source/DiagnosticLogsDemo.cpp", diff --git a/examples/lock-app/nxp/k32w1/README.md b/examples/lock-app/nxp/k32w1/README.md index 9b3cd33c1d4ed2..a085d94afd29d6 100644 --- a/examples/lock-app/nxp/k32w1/README.md +++ b/examples/lock-app/nxp/k32w1/README.md @@ -12,6 +12,7 @@ For generic information related to door lock application, please see the - [Flashing the host image](#flashing-the-host-image) - [Debugging](#debugging) - [OTA](#ota) + - [Multiple BLE connections](#multiple-ble-connections) ## Introduction @@ -163,3 +164,15 @@ Run -> Debug Configurations... -> C/C++ Application Please see [k32w1 OTA guide](../../../../docs/guides/nxp/nxp_mcxw71_ota_guide.md). + +## Multiple BLE connections + +To compile with the Multiple BLE connections support demo example add the gn +argument `nxp_multiple_ble_connections=true`. + +The application will accept multiple BLE connections after commissioning, by +pressing the BLE advertise button again. Once discovered by a BLE central, a +custom GATT service will be visible on the device. + +The user can change the default behavior by implementing the class defined in +[BLEApplicationManager.h](../../../platform/nxp/common/app_ble/include/BLEApplicationManager.h) diff --git a/examples/lock-app/nxp/mcxw71/BUILD.gn b/examples/lock-app/nxp/mcxw71/BUILD.gn index febab870a524ca..6d105f16ffd163 100644 --- a/examples/lock-app/nxp/mcxw71/BUILD.gn +++ b/examples/lock-app/nxp/mcxw71/BUILD.gn @@ -92,6 +92,14 @@ mcxw71_k32w1_sdk("sdk") { "${example_platform_dir}/board/peripherals.h", ] } + + if (nxp_multiple_ble_connections) { + include_dirs += [ "${example_platform_dir}/app_ble/include" ] + defines += [ + "EXTRA_GATT_DB_HEADER=\"extra_gatt_db.h\"", + "EXTRA_GATT_UUID_HEADER=\"extra_gatt_uuid128.h\"", + ] + } } mcxw71_k32w1_executable("lock_app") { @@ -140,6 +148,7 @@ mcxw71_k32w1_executable("lock_app") { "${common_example_dir}/low_power/include", "${common_example_dir}/operational_keystore/include", "${common_example_dir}/ui_feedback/include", + "${common_example_dir}/app_ble/include", ] sources += [ @@ -189,6 +198,15 @@ mcxw71_k32w1_executable("lock_app") { deps += [ "${chip_root}/src/platform/nxp:nxp_ota" ] } + if (nxp_multiple_ble_connections) { + sources += + [ "${example_platform_dir}/app_ble/source/BLEApplicationManager.cpp" ] + } else { + sources += [ + "${common_example_dir}/app_ble/source/BLEApplicationManagerEmpty.cpp", + ] + } + if (chip_with_diag_logs_demo) { sources += [ "${common_example_dir}/diagnostic_logs/source/DiagnosticLogsDemo.cpp", diff --git a/examples/lock-app/nxp/mcxw71/README.md b/examples/lock-app/nxp/mcxw71/README.md index 593aed82f58641..db877d0c0075f7 100644 --- a/examples/lock-app/nxp/mcxw71/README.md +++ b/examples/lock-app/nxp/mcxw71/README.md @@ -12,6 +12,7 @@ For generic information related to door lock application, please see the - [Flashing the host image](#flashing-the-host-image) - [Debugging](#debugging) - [OTA](#ota) + - [Multiple BLE connections](#multiple-ble-connections) ## Introduction @@ -195,3 +196,15 @@ Run -> Debug Configurations... -> C/C++ Application Please see [mcxw71 OTA guide](../../../../docs/guides/nxp/nxp_mcxw71_ota_guide.md). + +## Multiple BLE connections + +To compile with the Multiple BLE connections support demo example add the gn +argument `nxp_multiple_ble_connections=true`. + +The application will accept multiple BLE connections after commissioning, by +pressing the BLE advertise button again. Once discovered by a BLE central, a +custom GATT service will be visible on the device. + +The user can change the default behavior by implementing the class defined in +[BLEApplicationManager.h](../../../platform/nxp/common/app_ble/include/BLEApplicationManager.h) diff --git a/examples/platform/nxp/common/app_ble/include/BLEApplicationManager.h b/examples/platform/nxp/common/app_ble/include/BLEApplicationManager.h new file mode 100644 index 00000000000000..21a417d9ced7ce --- /dev/null +++ b/examples/platform/nxp/common/app_ble/include/BLEApplicationManager.h @@ -0,0 +1,49 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * Copyright 2024 NXP + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include + +namespace chip::NXP::App { + +/** + * @brief This class describes a manager for extra application BLE-related + * functionality (e.g multiple BLE connections). + * + */ +class BLEApplicationManager +{ +public: + void Init(); + void EnableMultipleConnectionsHandler(); + +private: + static void EnableMultipleConnections(intptr_t arg); + + friend BLEApplicationManager & BleAppMgr(); + static BLEApplicationManager sInstance; +}; + +inline BLEApplicationManager & BleAppMgr() +{ + return BLEApplicationManager::sInstance; +} + +} // namespace chip::NXP::App diff --git a/examples/platform/nxp/common/app_ble/source/BLEApplicationManagerEmpty.cpp b/examples/platform/nxp/common/app_ble/source/BLEApplicationManagerEmpty.cpp new file mode 100644 index 00000000000000..17682f85738f1a --- /dev/null +++ b/examples/platform/nxp/common/app_ble/source/BLEApplicationManagerEmpty.cpp @@ -0,0 +1,39 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * Copyright 2024 NXP + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "BLEApplicationManager.h" + +using namespace ::chip::NXP::App; + +BLEApplicationManager BLEApplicationManager::sInstance; + +void BLEApplicationManager::Init(void) +{ + /*Empty implementation. Intentionally left blank */ +} + +void BLEApplicationManager::EnableMultipleConnectionsHandler(void) +{ + /*Empty implementation. Intentionally left blank */ +} + +void BLEApplicationManager::EnableMultipleConnections(intptr_t arg) +{ + /*Empty implementation. Intentionally left blank */ +} diff --git a/examples/platform/nxp/mcxw71_k32w1/app_ble/include/extra_gatt_db.h b/examples/platform/nxp/mcxw71_k32w1/app_ble/include/extra_gatt_db.h new file mode 100644 index 00000000000000..d30a4064a9ac5e --- /dev/null +++ b/examples/platform/nxp/mcxw71_k32w1/app_ble/include/extra_gatt_db.h @@ -0,0 +1,4 @@ +PRIMARY_SERVICE_UUID128(service_wireless_uart, uuid_service_wireless_uart) +CHARACTERISTIC_UUID128(char_uart_stream, uuid_uart_stream, (gGattCharPropWriteWithoutRsp_c)) +VALUE_UUID128_VARLEN(value_uart_stream, uuid_uart_stream, (gPermissionFlagWritable_c), gAttMaxWriteDataSize_d(gAttMaxMtu_c), 1, + 0x00) diff --git a/examples/platform/nxp/mcxw71_k32w1/app_ble/include/extra_gatt_uuid128.h b/examples/platform/nxp/mcxw71_k32w1/app_ble/include/extra_gatt_uuid128.h new file mode 100644 index 00000000000000..b741d0bc348cdd --- /dev/null +++ b/examples/platform/nxp/mcxw71_k32w1/app_ble/include/extra_gatt_uuid128.h @@ -0,0 +1,23 @@ +/* +* Declare all custom 128-bit UUIDs here using the format: +* +* UUID128(name, bytes) +* +* where: +* -name : an unique tag for the newly defined UUID; + will be used to reference this UUID when defining + services and characteristics in <> +* -bytes: 16 bytes representing the 128-bit value +* +* One definition per line. No semicolon required after each definition. +* +* example: +* UUID128(uuid_service_robot_characteristics, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, 0xEF, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, +0xCD, 0xEF) +* UUID128(uuid_char_robot_direction, 0x12, 0x34, 0x50, 0x00, 0x90, 0xAB, 0xCD, 0xEF, 0x12, 0x34, 0x56, 0x78, 0x90, 0xAB, 0xCD, +0xEF) +*/ +/* Services */ + +UUID128(uuid_service_wireless_uart, 0xE0, 0x1C, 0x4B, 0x5E, 0x1E, 0xEB, 0xA1, 0x5C, 0xEE, 0xF4, 0x5E, 0xBA, 0x00, 0x01, 0xFF, 0x01) +UUID128(uuid_uart_stream, 0xE0, 0x1C, 0x4B, 0x5E, 0x1E, 0xEB, 0xA1, 0x5C, 0xEE, 0xF4, 0x5E, 0xBA, 0x01, 0x01, 0xFF, 0x01) diff --git a/examples/platform/nxp/mcxw71_k32w1/app_ble/source/BLEApplicationManager.cpp b/examples/platform/nxp/mcxw71_k32w1/app_ble/source/BLEApplicationManager.cpp new file mode 100644 index 00000000000000..1a3b9113a24736 --- /dev/null +++ b/examples/platform/nxp/mcxw71_k32w1/app_ble/source/BLEApplicationManager.cpp @@ -0,0 +1,94 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * Copyright 2024 NXP + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "BLEApplicationManager.h" + +#include +#include +#include +#include + +#include "gatt_db_app_interface.h" +#include "gatt_db_handles.h" + +using namespace ::chip::DeviceLayer; +using namespace ::chip::DeviceLayer::Internal; +using namespace ::chip::NXP::App; + +BLEApplicationManager BLEApplicationManager::sInstance; + +void app_gap_callback(gapGenericEvent_t * event) +{ + /*Demo Gap application callback*/ +} + +void app_gatt_callback(deviceId_t id, gattServerEvent_t * event) +{ + /*Demo Gatt application callback*/ + + if (event->eventType == gEvtAttributeWrittenWithoutResponse_c) + { + if (event->eventData.attributeWrittenEvent.handle == value_uart_stream) + { + ChipLogProgress(DeviceLayer, "Write to custom service"); + } + } +} + +void BLEApplicationManager::Init(void) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + auto * bleManager = &chip::DeviceLayer::Internal::BLEMgrImpl(); + + bleManager->RegisterAppCallbacks(app_gap_callback, app_gatt_callback); + err = bleManager->AddWriteNotificationHandle((uint16_t) value_uart_stream); + + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Error while adding BLE write notification handle"); + } +} + +void BLEApplicationManager::EnableMultipleConnectionsHandler(void) +{ + /* Publish an event to the Matter task to always set the commissioning state in the Matter task context */ + PlatformMgr().ScheduleWork(EnableMultipleConnections, 0); +} + +void BLEApplicationManager::EnableMultipleConnections(intptr_t arg) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + /* Check the status of the commissioning */ + if (ConfigurationMgr().IsFullyProvisioned()) + { + ChipLogProgress(DeviceLayer, "Multiple connections, start advertising"); + auto * bleManager = &chip::DeviceLayer::Internal::BLEMgrImpl(); + bleManager->SetBLEServiceMode(kMultipleBLE_Enabled); + err = ConnectivityMgr().SetBLEAdvertisingEnabled(true); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DeviceLayer, "Error during ConnectivityMgr().SetBLEAdvertisingEnabled()"); + } + } + else + { + ChipLogProgress(DeviceLayer, "Device must be commissioned before adding multiple BLE connections"); + } +} diff --git a/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.cpp b/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.cpp index 6e5390d997a9b8..8bc61eeba64e72 100644 --- a/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.cpp +++ b/examples/platform/nxp/mcxw71_k32w1/button/ButtonManager.cpp @@ -20,6 +20,7 @@ #include "AppConfig.h" #include "AppMatterButton.h" #include "AppTask.h" +#include "BLEApplicationManager.h" #include "UserInterfaceFeedback.h" #include @@ -200,6 +201,8 @@ void ButtonManager::BleHandler(const AppEvent & event) #endif chip::NXP::App::GetAppTask().SwitchCommissioningStateHandler(); + + chip::NXP::App::BleAppMgr().EnableMultipleConnectionsHandler(); } #if (CHIP_CONFIG_ENABLE_ICD_LIT && CHIP_CONFIG_ENABLE_ICD_DSLS) diff --git a/src/platform/nxp/common/ble/BLEManagerCommon.cpp b/src/platform/nxp/common/ble/BLEManagerCommon.cpp index 02871e31f71058..6078fa80acb715 100644 --- a/src/platform/nxp/common/ble/BLEManagerCommon.cpp +++ b/src/platform/nxp/common/ble/BLEManagerCommon.cpp @@ -139,13 +139,13 @@ CHIP_ERROR BLEManagerCommon::_Init() { CHIP_ERROR err = CHIP_NO_ERROR; EventBits_t eventBits; - uint16_t attChipRxHandle[1] = { (uint16_t) value_chipoble_rx }; + mWriteNotificationHandle[mWriteHandleSize++] = (uint16_t) value_chipoble_rx; #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING - uint16_t attChipC3Handle[1] = { (uint16_t) value_chipoble_c3 }; + mReadNotificationHandle[mReadHandleSize++] = (uint16_t) value_chipoble_c3; #endif - mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Enabled; + mServiceMode = kCHIPoBLE_Enabled; // Check if BLE stack is initialized VerifyOrExit(!mFlags.Has(Flags::kK32WBLEStackInitialized), err = CHIP_ERROR_INCORRECT_STATE); @@ -196,9 +196,9 @@ CHIP_ERROR BLEManagerCommon::_Init() PWR_ChangeDeepSleepMode(cPWR_PowerDown_RamRet); #endif - GattServer_RegisterHandlesForWriteNotifications(1, attChipRxHandle); + GattServer_RegisterHandlesForWriteNotifications(mWriteHandleSize, mWriteNotificationHandle); #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING - VerifyOrExit(GattServer_RegisterHandlesForReadNotifications(1, attChipC3Handle) == gBleSuccess_c, + VerifyOrExit(GattServer_RegisterHandlesForReadNotifications(mReadHandleSize, mReadNotificationHandle) == gBleSuccess_c, err = CHIP_ERROR_INCORRECT_STATE); #endif @@ -221,7 +221,7 @@ CHIP_ERROR BLEManagerCommon::_Init() uint16_t BLEManagerCommon::_NumConnections(void) { - return static_cast(mDeviceConnected == true); + return mDeviceIds.size(); } bool BLEManagerCommon::_IsAdvertisingEnabled(void) @@ -238,7 +238,8 @@ CHIP_ERROR BLEManagerCommon::_SetAdvertisingEnabled(bool val) { CHIP_ERROR err = CHIP_NO_ERROR; - VerifyOrExit(mServiceMode != ConnectivityManager::kCHIPoBLEServiceMode_NotSupported, err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); + VerifyOrExit((mServiceMode == kCHIPoBLE_Enabled) || (mServiceMode == kMultipleBLE_Enabled), + err = CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE); if (mFlags.Has(Flags::kAdvertisingEnabled) != val) { @@ -284,10 +285,6 @@ CHIP_ERROR BLEManagerCommon::_GetDeviceName(char * buf, size_t bufSize) CHIP_ERROR BLEManagerCommon::_SetDeviceName(const char * deviceName) { - if (mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_NotSupported) - { - return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; - } if (deviceName != NULL && deviceName[0] != 0) { if (strlen(deviceName) >= kMaxDeviceNameLength) @@ -767,7 +764,7 @@ CHIP_ERROR BLEManagerCommon::StopAdvertising(void) mFlags.Clear(Flags::kAdvertising); mFlags.Clear(Flags::kRestartAdvertising); - if (!mDeviceConnected) + if (mDeviceIds.size()) { ble_err_t err = blekw_stop_advertising(); VerifyOrReturnError(err == BLE_OK, CHIP_ERROR_INCORRECT_STATE); @@ -794,7 +791,7 @@ void BLEManagerCommon::DriveBLEState(void) VerifyOrExit(mFlags.Has(Flags::kK32WBLEStackInitialized), err = CHIP_ERROR_INCORRECT_STATE); // Start advertising if needed... - if (mServiceMode == ConnectivityManager::kCHIPoBLEServiceMode_Enabled && mFlags.Has(Flags::kAdvertisingEnabled)) + if (((mServiceMode == kCHIPoBLE_Enabled) || (mServiceMode == kMultipleBLE_Enabled)) && mFlags.Has(Flags::kAdvertisingEnabled)) { // Start/re-start advertising if not already started, or if there is a pending change // to the advertising configuration. @@ -817,7 +814,7 @@ void BLEManagerCommon::DriveBLEState(void) if (err != CHIP_NO_ERROR) { ChipLogError(DeviceLayer, "Disabling CHIPoBLE service due to error: %s", ErrorStr(err)); - mServiceMode = ConnectivityManager::kCHIPoBLEServiceMode_Disabled; + mServiceMode = kCHIPoBLE_Disabled; } } @@ -863,7 +860,9 @@ void BLEManagerCommon::DoBleProcessing(void) } else if (msg->type == BLE_KW_MSG_MTU_CHANGED) { - blekw_start_connection_timeout(); + if (mServiceMode == kCHIPoBLE_Enabled) + blekw_start_connection_timeout(); + ChipLogProgress(DeviceLayer, "BLE MTU size has been changed to %d.", msg->data.u16); } else if (msg->type == BLE_KW_MSG_ATT_WRITTEN || msg->type == BLE_KW_MSG_ATT_LONG_WRITTEN || @@ -897,6 +896,32 @@ void BLEManagerCommon::RegisterAppCallbacks(BLECallbackDelegate::GapGenericCallb callbackDelegate.gattCallback = gattCallback; } +CHIP_ERROR BLEManagerCommon::AddWriteNotificationHandle(uint16_t name) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // This function should be called before calling BLEManagerCommon::_Init + VerifyOrExit(!mFlags.Has(Flags::kK32WBLEStackInitialized), err = CHIP_ERROR_INCORRECT_STATE); + + mWriteNotificationHandle[mWriteHandleSize++] = name; + +exit: + return err; +} + +CHIP_ERROR BLEManagerCommon::AddReadNotificationHandle(uint16_t name) +{ + CHIP_ERROR err = CHIP_NO_ERROR; + + // This function should be called before calling BLEManagerCommon::_Init + VerifyOrExit(!mFlags.Has(Flags::kK32WBLEStackInitialized), err = CHIP_ERROR_INCORRECT_STATE); + + mReadNotificationHandle[mReadHandleSize++] = name; + +exit: + return err; +} + void BLEManagerCommon::HandleConnectEvent(blekw_msg_t * msg) { uint8_t deviceId = msg->data.u8; @@ -906,10 +931,17 @@ void BLEManagerCommon::HandleConnectEvent(blekw_msg_t * msg) PWR_DisallowDeviceToSleep(); #endif - mDeviceId = deviceId; - mDeviceConnected = true; + mDeviceIds.insert(deviceId); + + if (mServiceMode == kCHIPoBLE_Enabled) + blekw_start_connection_timeout(); + + if (mServiceMode == kMultipleBLE_Enabled) + { + _SetAdvertisingEnabled(false); + mServiceMode = kMultipleBLE_Disabled; + } - blekw_start_connection_timeout(); PlatformMgr().ScheduleWork(DriveBLEState, 0); } @@ -922,7 +954,7 @@ void BLEManagerCommon::HandleConnectionCloseEvent(blekw_msg_t * msg) PWR_AllowDeviceToSleep(); #endif - mDeviceConnected = false; + mDeviceIds.erase(deviceId); ChipDeviceEvent event; event.Type = DeviceEventType::kCHIPoBLEConnectionClosed; @@ -946,7 +978,8 @@ void BLEManagerCommon::HandleWriteEvent(blekw_msg_t * msg) ChipLogProgress(DeviceLayer, "Attribute write request(device: %d,handle: %d).", att_wr_data->device_id, att_wr_data->handle); #endif - blekw_start_connection_timeout(); + if (mServiceMode == kCHIPoBLE_Enabled) + blekw_start_connection_timeout(); if (value_chipoble_rx == att_wr_data->handle) { @@ -1047,9 +1080,12 @@ void BLEManagerCommon::HandleForceDisconnect() ChipLogProgress(DeviceLayer, "BLE connection timeout: Forcing disconnection."); /* Set the advertising parameters */ - if (Gap_Disconnect(mDeviceId) != gBleSuccess_c) + for (auto & id : mDeviceIds) { - ChipLogProgress(DeviceLayer, "Gap_Disconnect() failed."); + if (Gap_Disconnect(id) != gBleSuccess_c) + { + ChipLogProgress(DeviceLayer, "Gap_Disconnect() failed."); + } } #if defined(chip_with_low_power) && (chip_with_low_power == 1) diff --git a/src/platform/nxp/common/ble/BLEManagerCommon.h b/src/platform/nxp/common/ble/BLEManagerCommon.h index 780ee194b8b28f..36c4304174351f 100644 --- a/src/platform/nxp/common/ble/BLEManagerCommon.h +++ b/src/platform/nxp/common/ble/BLEManagerCommon.h @@ -27,6 +27,8 @@ #if CHIP_DEVICE_CONFIG_ENABLE_CHIPOBLE +#include + #include "fsl_os_abstraction.h" #include "ble_conn_manager.h" @@ -59,6 +61,15 @@ struct BLECallbackDelegate GattServerCallback gattCallback = nullptr; }; +typedef enum service_mode_t +{ + kCHIPoBLE_NotSupported = 0, + kCHIPoBLE_Enabled, + kCHIPoBLE_Disabled, + kMultipleBLE_Enabled, + kMultipleBLE_Disabled, +} service_mode_t; + /** * Base class for different platform implementations (K32W0 and K32W1 for now). */ @@ -69,7 +80,6 @@ class BLEManagerCommon : public BLEManager, protected BleLayer, private BlePlatf CHIP_ERROR _Init(void); CHIP_ERROR _Shutdown() { return CHIP_NO_ERROR; } - CHIPoBLEServiceMode _GetCHIPoBLEServiceMode(void); CHIP_ERROR _SetCHIPoBLEServiceMode(CHIPoBLEServiceMode val); bool _IsAdvertisingEnabled(void); CHIP_ERROR _SetAdvertisingEnabled(bool val); @@ -116,6 +126,11 @@ class BLEManagerCommon : public BLEManager, protected BleLayer, private BlePlatf kUnusedIndex = 0xFF, }; + enum + { + kMaxHandles = 5, + }; + typedef enum { BLE_KW_MSG_ERROR = 0x01, @@ -175,14 +190,18 @@ class BLEManagerCommon : public BLEManager, protected BleLayer, private BlePlatf uint16_t handle; } blekw_att_read_data_t; - CHIPoBLEServiceMode mServiceMode; + service_mode_t mServiceMode; char mDeviceName[kMaxDeviceNameLength + 1]; #if CHIP_ENABLE_ADDITIONAL_DATA_ADVERTISING chip::System::PacketBufferHandle c3AdditionalDataBufferHandle; #endif - uint8_t mDeviceId; + std::set mDeviceIds; bool mDeviceSubscribed = false; - bool mDeviceConnected = false; + + uint8_t mReadHandleSize = 0; + uint8_t mWriteHandleSize = 0; + uint16_t mReadNotificationHandle[kMaxHandles]; + uint16_t mWriteNotificationHandle[kMaxHandles]; void DriveBLEState(void); CHIP_ERROR ConfigureAdvertising(void); @@ -235,12 +254,13 @@ class BLEManagerCommon : public BLEManager, protected BleLayer, private BlePlatf BLECallbackDelegate callbackDelegate; void RegisterAppCallbacks(BLECallbackDelegate::GapGenericCallback gapCallback, BLECallbackDelegate::GattServerCallback gattCallback); -}; -inline BLEManager::CHIPoBLEServiceMode BLEManagerCommon::_GetCHIPoBLEServiceMode(void) -{ - return mServiceMode; -} + CHIP_ERROR AddWriteNotificationHandle(uint16_t name); + CHIP_ERROR AddReadNotificationHandle(uint16_t name); + + service_mode_t GetBLEServiceMode(void) { return mServiceMode; } + void SetBLEServiceMode(service_mode_t mode) { mServiceMode = mode; }; +}; } // namespace Internal } // namespace DeviceLayer From 99a866d48884c45da63e997de8c162c57cd6c20e Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 18 Sep 2024 12:10:05 -0400 Subject: [PATCH 17/47] Controller suspend/resume should stop/start operational advertising as needed. (#35635) --- .../CHIP/MTRDeviceControllerFactory.mm | 16 +++ .../MTRDeviceControllerFactory_Internal.h | 8 ++ .../CHIP/MTRDeviceController_Concrete.mm | 24 +++- .../CHIPTests/MTRPerControllerStorageTests.m | 134 +++++++++++++++++- 4 files changed, 179 insertions(+), 3 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index e47415880cdb13..ee0f330b26cfc2 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -1244,6 +1244,22 @@ - (MTROperationalBrowser *)operationalBrowser return _operationalBrowser.get(); } +- (FabricTable * _Nullable)fabricTable +{ + assertChipStackLockedByCurrentThread(); + + if (_controllerFactory == nullptr) { + return nullptr; + } + + auto systemState = _controllerFactory->GetSystemState(); + if (systemState == nullptr) { + return nullptr; + } + + return systemState->Fabrics(); +} + @end @interface MTRDummyStorage : NSObject diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h index 58592b6ed4b670..7c59a65dba42c2 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h @@ -32,6 +32,7 @@ #import "MTRDeviceControllerFactory.h" #import "MTROperationalBrowser.h" +#include #include #include #include @@ -111,6 +112,13 @@ MTR_DIRECT_MEMBERS @property (readonly) chip::Credentials::GroupDataProvider * groupDataProvider; @property (readonly, assign) MTROperationalBrowser * operationalBrowser; +// fabricTable must be gotten on the Matter queue. May return null if there are +// no controllers running. +@property (readonly, nullable, assign) chip::FabricTable * fabricTable; + +// resetOperationalAdvertising must happen on the Matter queue. +- (void)resetOperationalAdvertising; + @end MTR_DIRECT_MEMBERS diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index 0cbb8b7e95d8c4..97f47a50faca06 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -113,6 +113,9 @@ @interface MTRDeviceController_Concrete () @property (nonatomic, readonly) MTRDeviceStorageBehaviorConfiguration * storageBehaviorConfiguration; +// Whether we should be advertising our operational identity when we are not suspended. +@property (nonatomic, readonly) BOOL shouldAdvertiseOperational; + @end @implementation MTRDeviceController_Concrete { @@ -358,6 +361,15 @@ - (void)_controllerSuspended MTRDeviceControllerFactory * factory = _factory; dispatch_async(_chipWorkQueue, ^{ factory.operationalBrowser->ControllerDeactivated(); + + if (self.shouldAdvertiseOperational) { + auto * fabricTable = factory.fabricTable; + if (fabricTable) { + // We don't care about errors here. If our fabric is gone, nothing to do. + fabricTable->SetShouldAdvertiseIdentity(self->_storedFabricIndex, chip::FabricTable::AdvertiseIdentity::No); + [factory resetOperationalAdvertising]; + } + } }); } @@ -366,6 +378,15 @@ - (void)_controllerResumed MTRDeviceControllerFactory * factory = _factory; dispatch_async(_chipWorkQueue, ^{ factory.operationalBrowser->ControllerActivated(); + + if (self.shouldAdvertiseOperational) { + auto * fabricTable = factory.fabricTable; + if (fabricTable) { + // We don't care about errors here. If our fabric is gone, nothing to do. + fabricTable->SetShouldAdvertiseIdentity(self->_storedFabricIndex, chip::FabricTable::AdvertiseIdentity::Yes); + [factory resetOperationalAdvertising]; + } + } }); } @@ -668,7 +689,8 @@ - (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams commissionerParams.controllerNOC = noc; } commissionerParams.controllerVendorId = static_cast([startupParams.vendorID unsignedShortValue]); - commissionerParams.enableServerInteractions = startupParams.advertiseOperational; + _shouldAdvertiseOperational = startupParams.advertiseOperational; + commissionerParams.enableServerInteractions = !self.suspended && self.shouldAdvertiseOperational; // We never want plain "removal" from the fabric table since this leaves // the in-memory state out of sync with what's in storage. In per-controller diff --git a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m index 096349c985b84f..e94863d4f50080 100644 --- a/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m +++ b/src/darwin/Framework/CHIPTests/MTRPerControllerStorageTests.m @@ -16,6 +16,7 @@ #import +#import #import #import "MTRDeviceControllerLocalTestStorage.h" @@ -207,6 +208,109 @@ - (void)issueOperationalCertificateForRequest:(MTROperationalCSRInfo *)csrInfo @end +@interface MTRPerControllerStorageTestsOperationalBrowser : NSObject + +// expectedNodeID should be a 16-char uppercase hex string encoding the 64-bit +// node ID. +- (instancetype)initWithNodeID:(NSString *)expectedNodeID; +- (void)shutdown; + +@property (nonatomic, readwrite) NSString * expectedNodeID; +@property (nonatomic, readwrite, nullable) XCTestExpectation * addedExpectation; +@property (nonatomic, readwrite, nullable) XCTestExpectation * removedExpectation; + +- (void)onBrowse:(DNSServiceFlags)flags error:(DNSServiceErrorType)error instanceName:(const char *)instanceName; + +@end + +static void OnBrowse(DNSServiceRef serviceRef, DNSServiceFlags flags, uint32_t interfaceId, + DNSServiceErrorType error, const char * name, const char * type, const char * domain, void * context) +{ + __auto_type * self = (__bridge MTRPerControllerStorageTestsOperationalBrowser *) context; + [self onBrowse:flags error:error instanceName:name]; +} + +@implementation MTRPerControllerStorageTestsOperationalBrowser { + DNSServiceRef _browseRef; +} + +- (instancetype)initWithNodeID:(NSString *)expectedNodeID +{ + if (!(self = [super init])) { + return nil; + } + + _expectedNodeID = expectedNodeID; + + __auto_type queue = dispatch_get_main_queue(); + + __auto_type err = DNSServiceBrowse(&_browseRef, /* DNSServiceFlags = */ 0, kDNSServiceInterfaceIndexAny, "_matter._tcp", "local.", OnBrowse, (__bridge void *) self); + XCTAssertEqual(err, kDNSServiceErr_NoError); + if (err != kDNSServiceErr_NoError) { + return nil; + } + + err = DNSServiceSetDispatchQueue(_browseRef, queue); + XCTAssertEqual(err, kDNSServiceErr_NoError); + if (err != kDNSServiceErr_NoError) { + DNSServiceRefDeallocate(_browseRef); + _browseRef = nil; + return nil; + } + + return self; +} + +- (void)shutdown +{ + if (_browseRef) { + DNSServiceRefDeallocate(_browseRef); + _browseRef = nil; + } +} + +- (void)onBrowse:(DNSServiceFlags)flags error:(DNSServiceErrorType)error instanceName:(const char *)instanceName +{ + XCTAssertEqual(error, kDNSServiceErr_NoError); + if (error != kDNSServiceErr_NoError) { + DNSServiceRefDeallocate(_browseRef); + _browseRef = nil; + return; + } + + __auto_type len = strlen(instanceName); + XCTAssertEqual(len, 33); // Matter instance names are 33 chars. + + if (len != 33) { + return; + } + + // Skip over compressed fabric id and dash. + // TODO: Consider checking the compressed fabric ID? That's a bit hard to + // do, in general, since it depends on our keys. + const char * nodeID = &instanceName[17]; + NSString * browsedNode = [NSString stringWithUTF8String:nodeID]; + if (![browsedNode isEqual:self.expectedNodeID]) { + return; + } + + if (flags & kDNSServiceFlagsAdd) { + if (self.addedExpectation) { + XCTestExpectation * expectation = self.addedExpectation; + self.addedExpectation = nil; + [expectation fulfill]; + } + } else { + if (self.removedExpectation) { + XCTestExpectation * expectation = self.removedExpectation; + self.removedExpectation = nil; + [expectation fulfill]; + } + } +} + +@end + @interface MTRPerControllerStorageTests : MTRTestCase @end @@ -1665,6 +1769,12 @@ - (void)test011_TestDataStoreMTRDeviceWithStorageBehaviorOptimizationDisabled // suspension tests to a different file. - (void)test012_startSuspended { + // Needs to match the 888 == 0x378 for the node ID below. + __auto_type * operationalBrowser = [[MTRPerControllerStorageTestsOperationalBrowser alloc] initWithNodeID:@"0000000000000378"]; + XCTestExpectation * initialAdvertisingExpectation = [self expectationWithDescription:@"Controller advertising initially"]; + operationalBrowser.addedExpectation = initialAdvertisingExpectation; + initialAdvertisingExpectation.inverted = YES; // We should not in fact advertise, since we are suspended. + NSError * error; __auto_type * storageDelegate = [[MTRTestPerControllerStorage alloc] initWithControllerID:[NSUUID UUID]]; __auto_type * controller = [self startControllerWithRootKeys:[[MTRTestKeys alloc] init] @@ -1675,6 +1785,7 @@ - (void)test012_startSuspended caseAuthenticatedTags:nil paramsModifier:^(MTRDeviceControllerExternalCertificateParameters * params) { params.startSuspended = YES; + params.shouldAdvertiseOperational = YES; } error:&error]; @@ -1691,17 +1802,28 @@ - (void)test012_startSuspended [controller setupCommissioningSessionWithPayload:payload newNodeID:@(17) error:&error]; XCTAssertNotNil(error); + [self waitForExpectations:@[ initialAdvertisingExpectation ] timeout:kTimeoutInSeconds]; + [controller shutdown]; + + [operationalBrowser shutdown]; } - (void)test013_suspendDevices { + // getMTRDevice uses "123" for the node ID of the controller, which is hex 0x7B + __auto_type * operationalBrowser = [[MTRPerControllerStorageTestsOperationalBrowser alloc] initWithNodeID:@"000000000000007B"]; + XCTestExpectation * initialAdvertisingExpectation = [self expectationWithDescription:@"Controller advertising initially"]; + operationalBrowser.addedExpectation = initialAdvertisingExpectation; + NSNumber * deviceID = @(17); __auto_type * device = [self getMTRDevice:deviceID]; __auto_type * controller = device.deviceController; XCTAssertFalse(controller.suspended); + [self waitForExpectations:@[ initialAdvertisingExpectation ] timeout:kTimeoutInSeconds]; + __auto_type queue = dispatch_get_main_queue(); __auto_type * delegate = [[MTRDeviceTestDelegate alloc] init]; @@ -1757,6 +1879,9 @@ - (void)test013_suspendDevices } }); + XCTestExpectation * advertisingStoppedExpectation = [self expectationWithDescription:@"Controller stopped advertising"]; + operationalBrowser.removedExpectation = advertisingStoppedExpectation; + [controller suspend]; XCTAssertTrue(controller.suspended); @@ -1767,7 +1892,7 @@ - (void)test013_suspendDevices [toggle2Expectation fulfill]; }]; - [self waitForExpectations:@[ becameUnreachableExpectation, toggle2Expectation, suspendedExpectation, browseStoppedExpectation ] timeout:kTimeoutInSeconds]; + [self waitForExpectations:@[ becameUnreachableExpectation, toggle2Expectation, suspendedExpectation, browseStoppedExpectation, advertisingStoppedExpectation ] timeout:kTimeoutInSeconds]; XCTestExpectation * newSubscriptionExpectation = [self expectationWithDescription:@"Subscription has been set up again"]; XCTestExpectation * newReachableExpectation = [self expectationWithDescription:@"Device became reachable again"]; @@ -1790,10 +1915,13 @@ - (void)test013_suspendDevices } }); + XCTestExpectation * advertisingResumedExpectation = [self expectationWithDescription:@"Controller resumed advertising"]; + operationalBrowser.addedExpectation = advertisingResumedExpectation; + [controller resume]; XCTAssertFalse(controller.suspended); - [self waitForExpectations:@[ newSubscriptionExpectation, newReachableExpectation, resumedExpectation, browseRestartedExpectation ] timeout:kSubscriptionTimeoutInSeconds]; + [self waitForExpectations:@[ newSubscriptionExpectation, newReachableExpectation, resumedExpectation, browseRestartedExpectation, advertisingResumedExpectation ] timeout:kSubscriptionTimeoutInSeconds]; MTRSetLogCallback(MTRLogTypeProgress, nil); @@ -1814,6 +1942,8 @@ - (void)test013_suspendDevices ResetCommissionee(baseDevice, queue, self, kTimeoutInSeconds); [controller shutdown]; + + [operationalBrowser shutdown]; } // TODO: This might want to go in a separate test file, with some shared setup From 2396bb429a9d81ccb542d1acbb4837a5e5ea7e87 Mon Sep 17 00:00:00 2001 From: Thomas Lea <35579828+tleacmcsa@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:16:45 -0500 Subject: [PATCH 18/47] Added missing close commissioning window cmds (#35633) TC-TBRM-2.4 TC-THNETDIR-2.3 TC-WIFINM-2.2 fixes #4685 --- src/app/tests/suites/certification/Test_TC_TBRM_2_4.yaml | 6 ++++++ .../tests/suites/certification/Test_TC_THNETDIR_2_3.yaml | 6 ++++++ src/app/tests/suites/certification/Test_TC_WIFINM_2_2.yaml | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/src/app/tests/suites/certification/Test_TC_TBRM_2_4.yaml b/src/app/tests/suites/certification/Test_TC_TBRM_2_4.yaml index d1483c1c5a930a..4b358e1bd7575b 100644 --- a/src/app/tests/suites/certification/Test_TC_TBRM_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_TBRM_2_4.yaml @@ -84,3 +84,9 @@ tests: command: GetPendingDatasetRequest response: error: UNSUPPORTED_ACCESS + + - label: "Cleanup: Close the commissioning window" + endpoint: 0 + cluster: Administrator Commissioning + command: RevokeCommissioning + timedInteractionTimeoutMs: 2000 diff --git a/src/app/tests/suites/certification/Test_TC_THNETDIR_2_3.yaml b/src/app/tests/suites/certification/Test_TC_THNETDIR_2_3.yaml index f0b5b9bf2288ba..9d7d4de6ee3ac8 100644 --- a/src/app/tests/suites/certification/Test_TC_THNETDIR_2_3.yaml +++ b/src/app/tests/suites/certification/Test_TC_THNETDIR_2_3.yaml @@ -83,3 +83,9 @@ tests: value: TestNetworkExtendedPanId response: error: UNSUPPORTED_ACCESS + + - label: "Cleanup: Close the commissioning window" + endpoint: 0 + cluster: Administrator Commissioning + command: RevokeCommissioning + timedInteractionTimeoutMs: 2000 diff --git a/src/app/tests/suites/certification/Test_TC_WIFINM_2_2.yaml b/src/app/tests/suites/certification/Test_TC_WIFINM_2_2.yaml index 3aaa04996681c8..774fb3ce050f1c 100644 --- a/src/app/tests/suites/certification/Test_TC_WIFINM_2_2.yaml +++ b/src/app/tests/suites/certification/Test_TC_WIFINM_2_2.yaml @@ -80,3 +80,9 @@ tests: command: NetworkPassphraseRequest response: error: UNSUPPORTED_ACCESS + + - label: "Cleanup: Close the commissioning window" + endpoint: 0 + cluster: Administrator Commissioning + command: RevokeCommissioning + timedInteractionTimeoutMs: 2000 From 0b8ffb7c3f6a7a09e9294a00994cb90571808089 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 18 Sep 2024 14:53:18 -0400 Subject: [PATCH 19/47] Make use of DataModel::Provider in writes (#34754) * Implement DM::Provider::Write usage * Fix compile * Fix java builds * Update src/app/InteractionModelEngine.cpp Co-authored-by: Boris Zbarsky * Make codegen data model call increasing the cluster data version * Restyle * Make sure that attribute changed information can be propagated out of ember * Optimize storage size of WriteHandler * Restyle * Make the code more obvious identical with what was there before * Change Provider to not double-call the dirty and version increase * Update src/app/InteractionModelEngine.cpp Co-authored-by: Boris Zbarsky * Cleaner usage: no need of a separate function that is used in one place only * Attempt an API update * Fix typos in the Accessors src * Fix typo and regen * More fixes on accessors * Update signature for emAfWriteAttributeExternal * Add a comment about all the checks being vague * Update src/app/util/af-types.h Co-authored-by: Boris Zbarsky * Update src/app/util/af-types.h Co-authored-by: Boris Zbarsky * Update src/app/util/attribute-storage.cpp Co-authored-by: Boris Zbarsky * Update src/app/zap-templates/templates/app/attributes/Accessors-src.zapt Co-authored-by: Boris Zbarsky * Update src/app/util/mock/CodegenEmberMocks.cpp Co-authored-by: Boris Zbarsky * Update src/app/zap-templates/templates/app/attributes/Accessors-src.zapt Co-authored-by: Boris Zbarsky * Update src/app/zap-templates/templates/app/attributes/Accessors-src.zapt Co-authored-by: Boris Zbarsky * zap regen and restyle * Update src/app/zap-templates/templates/app/attributes/Accessors-src.zapt Co-authored-by: Boris Zbarsky * Update src/app/util/attribute-table.cpp Co-authored-by: Boris Zbarsky * Update src/app/util/attribute-storage.cpp Co-authored-by: Boris Zbarsky * Update src/app/util/attribute-storage.cpp Co-authored-by: Boris Zbarsky * Update src/app/util/attribute-table.cpp Co-authored-by: Boris Zbarsky * Update src/app/util/attribute-table.cpp Co-authored-by: Boris Zbarsky * Update src/app/util/attribute-storage.cpp Co-authored-by: Boris Zbarsky * Update src/app/util/attribute-table.h Co-authored-by: Boris Zbarsky * Rename ChangedPathListener to AttributesChangedListener * Remove chip:: and chip::app * Update constructors of AttributePathParams and add nodiscard according to the linter to never call const methods without considering their return value * Restyled by clang-format * Remove auto-inserted include * Update again and zap regen: removed extra namespace prefixes in accessors.h/cpp * Add comment about uint8_t non-const usage... * Another rename given that the listener is now an attributes and not a path listener * Update src/app/util/attribute-table.h Co-authored-by: Tennessee Carmel-Veilleux * Update after merge to have more things compile * Everything compiles now * Restyle * Make unit tests pass: mocks also have to call the change listeners * Comment update to talk more about AttributesChangedListener * Restyle * Add support for a previous path write ... this is similar to what ACL caching and tokenizing currently does, but in a explicit manner describing the ACL use case * Remove some extra added includes * Another include fix * Follow the comment and do not restrict the cache to ACL cluster, since this is what current ember does * More self code review changes * Make tests pass, more code cleanup * Match ordering to ember-compatibility functions. This is ODD because we check attribute existance before access! * Adjust test ordering and add a large note that we are probably doing the wrong thing, however tests force us to do the wrong thing * Fix unit test * Remove odd comment * Add a few ending endifs * Renamed ScopedExchangeContext * Update src/app/InteractionModelEngine.h Co-authored-by: Boris Zbarsky * Update src/app/WriteHandler.h Co-authored-by: Boris Zbarsky * Update src/app/WriteHandler.h Co-authored-by: Boris Zbarsky * Update src/app/data-model-provider/OperationTypes.h Co-authored-by: Boris Zbarsky * Update src/app/data-model-provider/OperationTypes.h Co-authored-by: Boris Zbarsky * Update src/app/data-model-provider/OperationTypes.h Co-authored-by: Boris Zbarsky * Update src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp Co-authored-by: Boris Zbarsky * Restyle to reorder includes * Add issue link * Update equality logic * Rename member to mLastSuccessfullyWrittenPath * Update argument logic * Make ActionContext private in IME so it is not such a public API * Clean up comments * fix up compares * Restyle --------- Co-authored-by: Andrei Litvin Co-authored-by: Boris Zbarsky Co-authored-by: Restyled.io Co-authored-by: Tennessee Carmel-Veilleux --- src/app/AttributeValueDecoder.h | 2 + src/app/EventManagement.cpp | 7 + src/app/EventManagement.h | 8 +- src/app/InteractionModelEngine.cpp | 43 +++++- src/app/InteractionModelEngine.h | 27 +++- src/app/WriteHandler.cpp | 52 ++++++- src/app/WriteHandler.h | 14 +- .../CodegenDataModelProvider_Write.cpp | 119 ++++++++++----- .../tests/EmberReadWriteOverride.cpp | 13 ++ .../tests/TestCodegenModelViaMocks.cpp | 56 +++++-- src/app/data-model-provider/OperationTypes.h | 15 +- .../ProviderChangeListener.h | 4 +- src/app/reporting/Engine.cpp | 12 +- src/app/reporting/Engine.h | 6 +- src/app/tests/TestWriteInteraction.cpp | 11 +- src/app/tests/test-interaction-model-api.cpp | 28 +++- src/app/util/mock/CodegenEmberMocks.cpp | 8 +- src/app/util/mock/attribute-storage.cpp | 7 + .../tests/data_model/DataModelFixtures.cpp | 141 +++++++++++++++++- src/controller/tests/data_model/TestWrite.cpp | 17 ++- 20 files changed, 513 insertions(+), 77 deletions(-) diff --git a/src/app/AttributeValueDecoder.h b/src/app/AttributeValueDecoder.h index 5f5e2255b2fa3e..79a749bbb812b4 100644 --- a/src/app/AttributeValueDecoder.h +++ b/src/app/AttributeValueDecoder.h @@ -65,6 +65,8 @@ class AttributeValueDecoder const Access::SubjectDescriptor & GetSubjectDescriptor() const { return mSubjectDescriptor; } private: + friend class TestOnlyAttributeValueDecoderAccessor; + TLV::TLVReader & mReader; bool mTriedDecode = false; const Access::SubjectDescriptor mSubjectDescriptor; diff --git a/src/app/EventManagement.cpp b/src/app/EventManagement.cpp index 7c0df844872b47..271f72ec107f3b 100644 --- a/src/app/EventManagement.cpp +++ b/src/app/EventManagement.cpp @@ -855,6 +855,12 @@ void EventManagement::SetScheduledEventInfo(EventNumber & aEventNumber, uint32_t aInitialWrittenEventBytes = mBytesWritten; } +CHIP_ERROR EventManagement::GenerateEvent(EventLoggingDelegate * eventPayloadWriter, const EventOptions & options, + EventNumber & generatedEventNumber) +{ + return LogEvent(eventPayloadWriter, options, generatedEventNumber); +} + void CircularEventBuffer::Init(uint8_t * apBuffer, uint32_t aBufferLength, CircularEventBuffer * apPrev, CircularEventBuffer * apNext, PriorityLevel aPriorityLevel) { @@ -914,5 +920,6 @@ CHIP_ERROR CircularEventBufferWrapper::GetNextBuffer(TLVReader & aReader, const exit: return err; } + } // namespace app } // namespace chip diff --git a/src/app/EventManagement.h b/src/app/EventManagement.h index ce5a34039ea0fe..76220350fc2507 100644 --- a/src/app/EventManagement.h +++ b/src/app/EventManagement.h @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -196,7 +197,7 @@ struct LogStorageResources * more space for new events. */ -class EventManagement +class EventManagement : public DataModel::EventsGenerator { public: /** @@ -387,6 +388,10 @@ class EventManagement */ void SetScheduledEventInfo(EventNumber & aEventNumber, uint32_t & aInitialWrittenEventBytes) const; + /* EventsGenerator implementation */ + CHIP_ERROR GenerateEvent(EventLoggingDelegate * eventPayloadWriter, const EventOptions & options, + EventNumber & generatedEventNumber) override; + private: /** * @brief @@ -559,5 +564,6 @@ class EventManagement System::Clock::Milliseconds64 mMonotonicStartupTime; }; + } // namespace app } // namespace chip diff --git a/src/app/InteractionModelEngine.cpp b/src/app/InteractionModelEngine.cpp index 9b4282fb036d88..338e1d1f6dce8c 100644 --- a/src/app/InteractionModelEngine.cpp +++ b/src/app/InteractionModelEngine.cpp @@ -895,7 +895,7 @@ Protocols::InteractionModel::Status InteractionModelEngine::OnWriteRequest(Messa { if (writeHandler.IsFree()) { - VerifyOrReturnError(writeHandler.Init(this) == CHIP_NO_ERROR, Status::Busy); + VerifyOrReturnError(writeHandler.Init(GetDataModelProvider(), this) == CHIP_NO_ERROR, Status::Busy); return writeHandler.OnWriteRequest(apExchangeContext, std::move(aPayload), aIsTimedWrite); } } @@ -996,6 +996,9 @@ CHIP_ERROR InteractionModelEngine::OnMessageReceived(Messaging::ExchangeContext Protocols::InteractionModel::Status status = Status::Failure; + // Ensure that DataModel::Provider has access to the exchange the message was received on. + CurrentExchangeValueScope scopedExchangeContext(*this, apExchangeContext); + // Group Message can only be an InvokeCommandRequest or WriteRequest if (apExchangeContext->IsGroupExchangeContext() && !aPayloadHeader.HasMessageType(Protocols::InteractionModel::MsgType::InvokeCommandRequest) && @@ -1749,16 +1752,44 @@ DataModel::Provider * InteractionModelEngine::SetDataModelProvider(DataModel::Pr // Alternting data model should not be done while IM is actively handling requests. VerifyOrDie(mReadHandlers.begin() == mReadHandlers.end()); - DataModel::Provider * oldModel = GetDataModelProvider(); - mDataModelProvider = model; + DataModel::Provider * oldModel = mDataModelProvider; + if (oldModel != nullptr) + { + CHIP_ERROR err = oldModel->Shutdown(); + if (err != CHIP_NO_ERROR) + { + ChipLogError(InteractionModel, "Failure on interaction model shutdown: %" CHIP_ERROR_FORMAT, err.Format()); + } + } + + mDataModelProvider = model; + if (mDataModelProvider != nullptr) + { + DataModel::InteractionModelContext context; + + context.eventsGenerator = &EventManagement::GetInstance(); + context.dataModelChangeListener = &mReportingEngine; + context.actionContext = this; + + CHIP_ERROR err = mDataModelProvider->Startup(context); + if (err != CHIP_NO_ERROR) + { + ChipLogError(InteractionModel, "Failure on interaction model startup: %" CHIP_ERROR_FORMAT, err.Format()); + } + } + return oldModel; } -DataModel::Provider * InteractionModelEngine::GetDataModelProvider() const +DataModel::Provider * InteractionModelEngine::GetDataModelProvider() { #if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE - // TODO: this should be temporary, we should fully inject the data model - VerifyOrReturnValue(mDataModelProvider != nullptr, CodegenDataModelProviderInstance()); + if (mDataModelProvider == nullptr) + { + // These should be called within the CHIP processing loop. + assertChipStackLockedByCurrentThread(); + SetDataModelProvider(CodegenDataModelProviderInstance()); + } #endif return mDataModelProvider; } diff --git a/src/app/InteractionModelEngine.h b/src/app/InteractionModelEngine.h index c371bad23b2d2c..8b7bd0743782cd 100644 --- a/src/app/InteractionModelEngine.h +++ b/src/app/InteractionModelEngine.h @@ -86,6 +86,7 @@ namespace app { */ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler, public Messaging::ExchangeDelegate, + private DataModel::ActionContext, public CommandResponseSender::Callback, public CommandHandlerImpl::Callback, public ReadHandler::ManagementCallback, @@ -402,7 +403,10 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler, } #endif - DataModel::Provider * GetDataModelProvider() const; + // Temporarily NOT const because the data model provider will be auto-set + // to codegen on first usage. This behaviour will be changed once each + // application must explicitly set the data model provider. + DataModel::Provider * GetDataModelProvider(); // MUST NOT be used while the interaction model engine is running as interaction // model functionality (e.g. active reads/writes/subscriptions) rely on data model @@ -412,6 +416,9 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler, DataModel::Provider * SetDataModelProvider(DataModel::Provider * model); private: + /* DataModel::ActionContext implementation */ + Messaging::ExchangeContext * CurrentExchange() override { return mCurrentExchange; } + friend class reporting::Engine; friend class TestCommandInteraction; friend class TestInteractionModelEngine; @@ -698,7 +705,23 @@ class InteractionModelEngine : public Messaging::UnsolicitedMessageHandler, SubscriptionResumptionStorage * mpSubscriptionResumptionStorage = nullptr; - DataModel::Provider * mDataModelProvider = nullptr; + DataModel::Provider * mDataModelProvider = nullptr; + Messaging::ExchangeContext * mCurrentExchange = nullptr; + + // Changes the current exchange context of a InteractionModelEngine to a given context + class CurrentExchangeValueScope + { + public: + CurrentExchangeValueScope(InteractionModelEngine & engine, Messaging::ExchangeContext * context) : mEngine(engine) + { + mEngine.mCurrentExchange = context; + } + + ~CurrentExchangeValueScope() { mEngine.mCurrentExchange = nullptr; } + + private: + InteractionModelEngine & mEngine; + }; }; } // namespace app diff --git a/src/app/WriteHandler.cpp b/src/app/WriteHandler.cpp index 15776eb545fc21..5050cbbee2fcb5 100644 --- a/src/app/WriteHandler.cpp +++ b/src/app/WriteHandler.cpp @@ -18,19 +18,25 @@ #include #include +#include #include #include #include #include #include +#include #include #include #include #include +#include #include #include +#include #include +#include + namespace chip { namespace app { @@ -38,10 +44,14 @@ using namespace Protocols::InteractionModel; using Status = Protocols::InteractionModel::Status; constexpr uint8_t kListAttributeType = 0x48; -CHIP_ERROR WriteHandler::Init(WriteHandlerDelegate * apWriteHandlerDelegate) +CHIP_ERROR WriteHandler::Init(DataModel::Provider * apProvider, WriteHandlerDelegate * apWriteHandlerDelegate) { VerifyOrReturnError(!mExchangeCtx, CHIP_ERROR_INCORRECT_STATE); VerifyOrReturnError(apWriteHandlerDelegate, CHIP_ERROR_INVALID_ARGUMENT); +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + VerifyOrReturnError(apProvider, CHIP_ERROR_INVALID_ARGUMENT); + mDataModelProvider = apProvider; +#endif // CHIP_CONFIG_USE_DATA_MODEL_INTERFACE mDelegate = apWriteHandlerDelegate; MoveToState(State::Initialized); @@ -63,6 +73,9 @@ void WriteHandler::Close() DeliverFinalListWriteEnd(false /* wasSuccessful */); mExchangeCtx.Release(); mStateFlags.Clear(StateBits::kSuppressResponse); +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + mDataModelProvider = nullptr; +#endif // CHIP_CONFIG_USE_DATA_MODEL_INTERFACE MoveToState(State::Uninitialized); } @@ -354,7 +367,7 @@ CHIP_ERROR WriteHandler::ProcessAttributeDataIBs(TLV::TLVReader & aAttributeData err = CHIP_NO_ERROR; } SuccessOrExit(err); - err = WriteSingleClusterData(subjectDescriptor, dataAttributePath, dataReader, this); + err = WriteClusterData(subjectDescriptor, dataAttributePath, dataReader); if (err != CHIP_NO_ERROR) { mWriteResponseBuilder.GetWriteResponses().Rollback(backup); @@ -501,7 +514,7 @@ CHIP_ERROR WriteHandler::ProcessGroupAttributeDataIBs(TLV::TLVReader & aAttribut DataModelCallbacks::GetInstance()->AttributeOperation(DataModelCallbacks::OperationType::Write, DataModelCallbacks::OperationOrder::Pre, dataAttributePath); - err = WriteSingleClusterData(subjectDescriptor, dataAttributePath, tmpDataReader, this); + err = WriteClusterData(subjectDescriptor, dataAttributePath, tmpDataReader); if (err != CHIP_NO_ERROR) { ChipLogError(DataManagement, @@ -552,6 +565,10 @@ Status WriteHandler::ProcessWriteRequest(System::PacketBufferHandle && aPayload, // our callees hand out Status as well. Status status = Status::InvalidAction; +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + mLastSuccessfullyWrittenPath = std::nullopt; +#endif // CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + reader.Init(std::move(aPayload)); err = writeRequestParser.Init(reader); @@ -559,7 +576,7 @@ Status WriteHandler::ProcessWriteRequest(System::PacketBufferHandle && aPayload, #if CHIP_CONFIG_IM_PRETTY_PRINT writeRequestParser.PrettyPrint(); -#endif +#endif // CHIP_CONFIG_IM_PRETTY_PRINT bool boolValue; boolValue = mStateFlags.Has(StateBits::kSuppressResponse); @@ -703,5 +720,32 @@ void WriteHandler::MoveToState(const State aTargetState) ChipLogDetail(DataManagement, "IM WH moving to [%s]", GetStateStr()); } +CHIP_ERROR WriteHandler::WriteClusterData(const Access::SubjectDescriptor & aSubject, const ConcreteDataAttributePath & aPath, + TLV::TLVReader & aData) +{ + // Writes do not have a checked-path. If data model interface is enabled (both checked and only version) + // the write is done via the DataModel interface +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + VerifyOrReturnError(mDataModelProvider != nullptr, CHIP_ERROR_INCORRECT_STATE); + + DataModel::WriteAttributeRequest request; + + request.path = aPath; + request.subjectDescriptor = aSubject; + request.previousSuccessPath = mLastSuccessfullyWrittenPath; + request.writeFlags.Set(DataModel::WriteFlags::kTimed, IsTimedWrite()); + + AttributeValueDecoder decoder(aData, aSubject); + + DataModel::ActionReturnStatus status = mDataModelProvider->WriteAttribute(request, decoder); + + mLastSuccessfullyWrittenPath = status.IsSuccess() ? std::make_optional(aPath) : std::nullopt; + + return AddStatusInternal(aPath, StatusIB(status.GetStatusCode())); +#else + return WriteSingleClusterData(aSubject, aPath, aData, this); +#endif // CHIP_CONFIG_USE_DATA_MODEL_INTERFACE +} + } // namespace app } // namespace chip diff --git a/src/app/WriteHandler.h b/src/app/WriteHandler.h index 0723a316738498..fe63e028b8dfee 100644 --- a/src/app/WriteHandler.h +++ b/src/app/WriteHandler.h @@ -21,8 +21,10 @@ #include #include #include +#include #include #include +#include #include #include #include @@ -69,6 +71,7 @@ class WriteHandler : public Messaging::ExchangeDelegate * construction until a call to Close is made to terminate the * instance. * + * @param[in] apProvider A valid pointer to the model used to forward writes towards * @param[in] apWriteHandlerDelegate A Valid pointer to the WriteHandlerDelegate. * * @retval #CHIP_ERROR_INVALID_ARGUMENT on invalid pointers @@ -77,7 +80,7 @@ class WriteHandler : public Messaging::ExchangeDelegate * @retval #CHIP_NO_ERROR On success. * */ - CHIP_ERROR Init(WriteHandlerDelegate * apWriteHandlerDelegate); + CHIP_ERROR Init(DataModel::Provider * apProvider, WriteHandlerDelegate * apWriteHandlerDelegate); /** * Process a write request. Parts of the processing may end up being asynchronous, but the WriteHandler @@ -182,11 +185,20 @@ class WriteHandler : public Messaging::ExchangeDelegate System::PacketBufferHandle && aPayload) override; void OnResponseTimeout(Messaging::ExchangeContext * apExchangeContext) override; + // Write the given data to the given path + CHIP_ERROR WriteClusterData(const Access::SubjectDescriptor & aSubject, const ConcreteDataAttributePath & aPath, + TLV::TLVReader & aData); + Messaging::ExchangeHolder mExchangeCtx; WriteResponseMessage::Builder mWriteResponseBuilder; Optional mProcessingAttributePath; Optional mACLCheckCache = NullOptional; +#if CHIP_CONFIG_USE_DATA_MODEL_INTERFACE + DataModel::Provider * mDataModelProvider = nullptr; + std::optional mLastSuccessfullyWrittenPath; +#endif + // This may be a "fake" pointer or a real delegate pointer, depending // on CHIP_CONFIG_STATIC_GLOBAL_INTERACTION_MODEL_ENGINE setting. // diff --git a/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp index ffb44eb492dc5a..9eee57d1491fa5 100644 --- a/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp +++ b/src/app/codegen-data-model-provider/CodegenDataModelProvider_Write.cpp @@ -15,6 +15,7 @@ * limitations under the License. */ #include +#include #include #include @@ -45,6 +46,17 @@ namespace { using namespace chip::app::Compatibility::Internal; using Protocols::InteractionModel::Status; +class ContextAttributesChangeListener : public AttributesChangedListener +{ +public: + ContextAttributesChangeListener(const DataModel::InteractionModelContext & context) : mListener(context.dataModelChangeListener) + {} + void MarkDirty(const AttributePathParams & path) override { mListener->MarkDirty(path); } + +private: + DataModel::ProviderChangeListener * mListener; +}; + /// Attempts to write via an attribute access interface (AAI) /// /// If it returns a CHIP_ERROR, then this is a FINAL result (i.e. either failure or success) @@ -273,27 +285,14 @@ DataModel::ActionReturnStatus CodegenDataModelProvider::WriteAttribute(const Dat ChipLogDetail(DataManagement, "Writing attribute: Cluster=" ChipLogFormatMEI " Endpoint=0x%x AttributeId=" ChipLogFormatMEI, ChipLogValueMEI(request.path.mClusterId), request.path.mEndpointId, ChipLogValueMEI(request.path.mAttributeId)); - // ACL check for non-internal requests - if (!request.operationFlags.Has(DataModel::OperationFlags::kInternal)) - { - ReturnErrorCodeIf(!request.subjectDescriptor.has_value(), Status::UnsupportedAccess); - - Access::RequestPath requestPath{ .cluster = request.path.mClusterId, - .endpoint = request.path.mEndpointId, - .requestType = Access::RequestType::kAttributeWriteRequest, - .entityId = request.path.mAttributeId }; - CHIP_ERROR err = Access::GetAccessControl().Check(*request.subjectDescriptor, requestPath, - RequiredPrivilege::ForWriteAttribute(request.path)); - - if (err != CHIP_NO_ERROR) - { - ReturnErrorCodeIf((err != CHIP_ERROR_ACCESS_DENIED) && (err != CHIP_ERROR_ACCESS_RESTRICTED_BY_ARL), err); - - // TODO: when wildcard/group writes are supported, handle them to discard rather than fail with status - return err == CHIP_ERROR_ACCESS_DENIED ? Status::UnsupportedAccess : Status::AccessRestricted; - } - } - + // TODO: ordering is to check writability/existence BEFORE ACL and this seems wrong, however + // existing unit tests (TC_AcessChecker.py) validate that we get UnsupportedWrite instead of UnsupportedAccess + // + // This should likely be fixed in spec (probably already fixed by + // https://github.com/CHIP-Specifications/connectedhomeip-spec/pull/9024) + // and tests and implementation + // + // Open issue that needs fixing: https://github.com/project-chip/connectedhomeip/issues/33735 auto metadata = Ember::FindAttributeMetadata(request.path); // Explicit failure in finding a suitable metadata @@ -322,7 +321,56 @@ DataModel::ActionReturnStatus CodegenDataModelProvider::WriteAttribute(const Dat if (!request.operationFlags.Has(DataModel::OperationFlags::kInternal)) { VerifyOrReturnError(!isReadOnly, Status::UnsupportedWrite); + } + + // ACL check for non-internal requests + bool checkAcl = !request.operationFlags.Has(DataModel::OperationFlags::kInternal); + // For chunking, ACL check is not re-done if the previous write was successful for the exact same + // path. We apply this everywhere as a shortcut, although realistically this is only for AccessControl cluster + if (checkAcl && request.previousSuccessPath.has_value()) + { + // NOTE: explicit cast/check only for attribute path and nothing else. + // + // In particular `request.path` is a DATA path (contains a list index) + // and we do not want request.previousSuccessPath to be auto-cast to a + // data path with a empty list and fail the compare. + // + // This could be `request.previousSuccessPath != request.path` (where order + // is important) however that would seem more brittle (relying that a != b + // behaves differently than b != a due to casts). Overall Data paths are not + // the same as attribute paths. + // + // Also note that Concrete path have a mExpanded that is not used in compares. + const ConcreteAttributePath & attributePathA = request.path; + const ConcreteAttributePath & attributePathB = *request.previousSuccessPath; + + checkAcl = (attributePathA != attributePathB); + } + + if (checkAcl) + { + ReturnErrorCodeIf(!request.subjectDescriptor.has_value(), Status::UnsupportedAccess); + + Access::RequestPath requestPath{ .cluster = request.path.mClusterId, + .endpoint = request.path.mEndpointId, + .requestType = Access::RequestType::kAttributeWriteRequest, + .entityId = request.path.mAttributeId }; + CHIP_ERROR err = Access::GetAccessControl().Check(*request.subjectDescriptor, requestPath, + RequiredPrivilege::ForWriteAttribute(request.path)); + + if (err != CHIP_NO_ERROR) + { + VerifyOrReturnValue(err != CHIP_ERROR_ACCESS_DENIED, Status::UnsupportedAccess); + VerifyOrReturnValue(err != CHIP_ERROR_ACCESS_RESTRICTED_BY_ARL, Status::AccessRestricted); + + return err; + } + } + + // Internal is allowed to bypass timed writes and read-only. + if (!request.operationFlags.Has(DataModel::OperationFlags::kInternal)) + { VerifyOrReturnError(!(*attributeMetadata)->MustUseTimedWrite() || request.writeFlags.Has(DataModel::WriteFlags::kTimed), Status::NeedsTimedInteraction); } @@ -349,6 +397,8 @@ DataModel::ActionReturnStatus CodegenDataModelProvider::WriteAttribute(const Dat } } + ContextAttributesChangeListener change_listener(CurrentContext()); + AttributeAccessInterface * aai = AttributeAccessInterfaceRegistry::Instance().Get(request.path.mEndpointId, request.path.mClusterId); std::optional aai_result = TryWriteViaAccessInterface(request.path, aai, decoder); @@ -356,11 +406,9 @@ DataModel::ActionReturnStatus CodegenDataModelProvider::WriteAttribute(const Dat { if (*aai_result == CHIP_NO_ERROR) { - // TODO: change callbacks should likely be routed through the context `MarkDirty` only - // however for now this is called directly because ember code does this call - // inside emberAfWriteAttribute. - MatterReportingAttributeChangeCallback(request.path); - CurrentContext().dataModelChangeListener->MarkDirty(request.path); + // TODO: this is awkward since it provides AAI no control over this, specifically + // AAI may not want to increase versions for some attributes that are Q + emberAfAttributeChanged(request.path.mEndpointId, request.path.mClusterId, request.path.mAttributeId, &change_listener); } return *aai_result; } @@ -376,18 +424,21 @@ DataModel::ActionReturnStatus CodegenDataModelProvider::WriteAttribute(const Dat return Status::InvalidValue; } + EmberAfWriteDataInput dataInput(dataBuffer.data(), (*attributeMetadata)->attributeType); + + dataInput.SetChangeListener(&change_listener); + // TODO: dataInput.SetMarkDirty() should be according to `ChangesOmmited` + if (request.operationFlags.Has(DataModel::OperationFlags::kInternal)) { // Internal requests use the non-External interface that has less enforcement // than the external version (e.g. does not check/enforce writable settings, does not // validate attribute types) - see attribute-table.h documentation for details. - status = emberAfWriteAttribute(request.path.mEndpointId, request.path.mClusterId, request.path.mAttributeId, - dataBuffer.data(), (*attributeMetadata)->attributeType); + status = emberAfWriteAttribute(request.path, dataInput); } else { - status = - emAfWriteAttributeExternal(request.path, EmberAfWriteDataInput(dataBuffer.data(), (*attributeMetadata)->attributeType)); + status = emAfWriteAttributeExternal(request.path, dataInput); } if (status != Protocols::InteractionModel::Status::Success) @@ -395,14 +446,6 @@ DataModel::ActionReturnStatus CodegenDataModelProvider::WriteAttribute(const Dat return status; } - // TODO: this WILL requre updates - // - // - Internal writes may need to be able to decide if to mark things dirty or not (see AAI as well) - // - Changes-ommited paths should not be marked dirty (ember is not aware of that flag) - // - This likely maps to `MatterReportingAttributeChangeCallback` HOWEVER current ember write functions - // will selectively call that one depending on old attribute state (i.e. calling every time is a - // change in behavior) - CurrentContext().dataModelChangeListener->MarkDirty(request.path); return CHIP_NO_ERROR; } diff --git a/src/app/codegen-data-model-provider/tests/EmberReadWriteOverride.cpp b/src/app/codegen-data-model-provider/tests/EmberReadWriteOverride.cpp index ac918049b860f4..5befbc14aa5715 100644 --- a/src/app/codegen-data-model-provider/tests/EmberReadWriteOverride.cpp +++ b/src/app/codegen-data-model-provider/tests/EmberReadWriteOverride.cpp @@ -16,6 +16,8 @@ */ #include "EmberReadWriteOverride.h" +#include +#include #include #include #include @@ -116,9 +118,15 @@ Status emAfWriteAttributeExternal(const chip::app::ConcreteAttributePath & path, // copy over as much data as possible // NOTE: we do NOT use (*metadata)->size since it is unclear if our mocks set that correctly size_t len = std::min(sizeof(gEmberIoBuffer), chip::app::Compatibility::Internal::gEmberAttributeIOBufferSpan.size()); + memcpy(gEmberIoBuffer, input.dataPtr, len); gEmberIoBufferFill = len; + if (input.changeListener != nullptr) + { + input.changeListener->MarkDirty(chip::app::AttributePathParams(path.mEndpointId, path.mClusterId, path.mAttributeId)); + } + return Status::Success; } @@ -128,3 +136,8 @@ Status emberAfWriteAttribute(chip::EndpointId endpoint, chip::ClusterId cluster, return emAfWriteAttributeExternal(chip::app::ConcreteAttributePath(endpoint, cluster, attributeID), EmberAfWriteDataInput(dataPtr, dataType)); } + +Status emberAfWriteAttribute(const chip::app::ConcreteAttributePath & path, const EmberAfWriteDataInput & input) +{ + return emAfWriteAttributeExternal(path, input); +} diff --git a/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp b/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp index d5c0ea673fec80..164d8856a9de62 100644 --- a/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp +++ b/src/app/codegen-data-model-provider/tests/TestCodegenModelViaMocks.cpp @@ -132,13 +132,13 @@ bool operator==(const Access::SubjectDescriptor & a, const Access::SubjectDescri class TestProviderChangeListener : public ProviderChangeListener { public: - void MarkDirty(const ConcreteAttributePath & path) override { mDirtyList.push_back(path); } + void MarkDirty(const AttributePathParams & path) override { mDirtyList.push_back(path); } - std::vector & DirtyList() { return mDirtyList; } - const std::vector & DirtyList() const { return mDirtyList; } + std::vector & DirtyList() { return mDirtyList; } + const std::vector & DirtyList() const { return mDirtyList; } private: - std::vector mDirtyList; + std::vector mDirtyList; }; class TestEventGenerator : public EventsGenerator @@ -802,12 +802,32 @@ void TestEmberScalarTypeWrite(const typename NumericAttributeTraits::WorkingT EXPECT_EQ(actual, value); ASSERT_EQ(model.ChangeListener().DirtyList().size(), 1u); - EXPECT_EQ(model.ChangeListener().DirtyList()[0], test.request.path); + EXPECT_EQ(model.ChangeListener().DirtyList()[0], + AttributePathParams(test.request.path.mEndpointId, test.request.path.mClusterId, test.request.path.mAttributeId)); // reset for the next test model.ChangeListener().DirtyList().clear(); } + // nullable test: write null to make sure content of buffer changed (otherwise it will be a noop for dirty checking) + { + TestWriteRequest test( + kAdminSubjectDescriptor, + ConcreteAttributePath(kMockEndpoint3, MockClusterId(4), MOCK_ATTRIBUTE_ID_FOR_NULLABLE_TYPE(ZclType))); + + using NumericType = NumericAttributeTraits; + using NullableType = chip::app::DataModel::Nullable; + AttributeValueDecoder decoder = test.DecoderFor(NullableType()); + + // write should succeed + ASSERT_EQ(model.WriteAttribute(test.request, decoder), CHIP_NO_ERROR); + + // dirty: we changed the value to null + ASSERT_EQ(model.ChangeListener().DirtyList().size(), 1u); + EXPECT_EQ(model.ChangeListener().DirtyList()[0], + AttributePathParams(test.request.path.mEndpointId, test.request.path.mClusterId, test.request.path.mAttributeId)); + } + // nullable test { TestWriteRequest test( @@ -827,8 +847,10 @@ void TestEmberScalarTypeWrite(const typename NumericAttributeTraits::WorkingT typename NumericAttributeTraits::WorkingType actual = NumericAttributeTraits::StorageToWorking(storage); ASSERT_EQ(actual, value); - ASSERT_EQ(model.ChangeListener().DirtyList().size(), 1u); - EXPECT_EQ(model.ChangeListener().DirtyList()[0], test.request.path); + // dirty a 2nd time when we moved from null to a real value + ASSERT_EQ(model.ChangeListener().DirtyList().size(), 2u); + EXPECT_EQ(model.ChangeListener().DirtyList()[1], + AttributePathParams(test.request.path.mEndpointId, test.request.path.mClusterId, test.request.path.mAttributeId)); } } @@ -1994,7 +2016,20 @@ TEST(TestCodegenModelViaMocks, EmberAttributeWriteAclDeny) CodegenDataModelProviderWithContext model; ScopedMockAccessControl accessControl; - TestWriteRequest test(kDenySubjectDescriptor, ConcreteDataAttributePath(kMockEndpoint1, MockClusterId(1), MockAttributeId(10))); + /* Using this path is also failing existence checks, so this cannot be enabled + * until we fix ordering of ACL to be done before existence checks + + TestWriteRequest test(kDenySubjectDescriptor, + ConcreteDataAttributePath(kMockEndpoint1, MockClusterId(1), MockAttributeId(10))); + AttributeValueDecoder decoder = test.DecoderFor(1234); + + ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::UnsupportedAccess); + ASSERT_TRUE(model.ChangeListener().DirtyList().empty()); + */ + + TestWriteRequest test(kDenySubjectDescriptor, + ConcreteDataAttributePath(kMockEndpoint3, MockClusterId(4), + MOCK_ATTRIBUTE_ID_FOR_NULLABLE_TYPE(ZCL_INT32U_ATTRIBUTE_TYPE))); AttributeValueDecoder decoder = test.DecoderFor(1234); ASSERT_EQ(model.WriteAttribute(test.request, decoder), Status::UnsupportedAccess); @@ -2431,12 +2466,13 @@ TEST(TestCodegenModelViaMocks, EmberWriteAttributeAccessInterfaceTest) // AAI marks dirty paths ASSERT_EQ(model.ChangeListener().DirtyList().size(), 1u); - EXPECT_EQ(model.ChangeListener().DirtyList()[0], kStructPath); + EXPECT_EQ(model.ChangeListener().DirtyList()[0], + AttributePathParams(kStructPath.mEndpointId, kStructPath.mClusterId, kStructPath.mAttributeId)); // AAI does not prevent read/write of regular attributes // validate that once AAI is added, we still can go through writing regular bits (i.e. // AAI returning "unknown" has fallback to ember) - TestEmberScalarTypeWrite(1234); + TestEmberScalarTypeWrite(4321); TestEmberScalarNullWrite(); } diff --git a/src/app/data-model-provider/OperationTypes.h b/src/app/data-model-provider/OperationTypes.h index 00ec0424763cf5..8758e02ef89c5d 100644 --- a/src/app/data-model-provider/OperationTypes.h +++ b/src/app/data-model-provider/OperationTypes.h @@ -70,15 +70,24 @@ struct ReadAttributeRequest : OperationRequest enum class WriteFlags : uint32_t { - kTimed = 0x0001, // Write is a timed write (i.e. a Timed Request Action preceeded it) - kListBegin = 0x0002, // This is the FIRST list of data elements - kListEnd = 0x0004, // This is the LAST list element to write + kTimed = 0x0001, // Write is a timed write (i.e. a Timed Request Action preceeded it) }; struct WriteAttributeRequest : OperationRequest { ConcreteDataAttributePath path; // NOTE: this also contains LIST operation options (i.e. "data" path type) BitFlags writeFlags; + + // The path of the previous successful write in the same write transaction, if any. + // + // In particular this means that a write to this path has succeeded before (i.e. it passed required ACL checks). + // The intent for this is to allow short-cutting ACL checks when ACL is in progress of being updated: + // - During write chunking, list writes can be of the form "reset list" followed by "append item by item" + // - When ACL is updating, a reset to empty would result in the entire ACL being deny and the "append" + // would fail. + // callers are expected to keep track of a `previousSuccessPath` whenever a write succeeds (otherwise ACL + // checks may fail) + std::optional previousSuccessPath; }; enum class InvokeFlags : uint32_t diff --git a/src/app/data-model-provider/ProviderChangeListener.h b/src/app/data-model-provider/ProviderChangeListener.h index 97061865921b0f..b0f6aab5f811f3 100644 --- a/src/app/data-model-provider/ProviderChangeListener.h +++ b/src/app/data-model-provider/ProviderChangeListener.h @@ -16,7 +16,7 @@ */ #pragma once -#include +#include namespace chip { namespace app { @@ -39,7 +39,7 @@ class ProviderChangeListener /// Mark all attributes matching the given path (which may be a wildcard) dirty. /// /// Wildcards are supported. - virtual void MarkDirty(const ConcreteAttributePath & path) = 0; + virtual void MarkDirty(const AttributePathParams & path) = 0; }; } // namespace DataModel diff --git a/src/app/reporting/Engine.cpp b/src/app/reporting/Engine.cpp index 072aa100e10312..cb4169420ee513 100644 --- a/src/app/reporting/Engine.cpp +++ b/src/app/reporting/Engine.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -1010,7 +1011,16 @@ void Engine::ScheduleUrgentEventDeliverySync(Optional fabricIndex) Run(); } -}; // namespace reporting +void Engine::MarkDirty(const AttributePathParams & path) +{ + CHIP_ERROR err = SetDirty(path); + if (err != CHIP_NO_ERROR) + { + ChipLogError(DataManagement, "Failed to set path dirty: %" CHIP_ERROR_FORMAT, err.Format()); + } +} + +} // namespace reporting } // namespace app } // namespace chip diff --git a/src/app/reporting/Engine.h b/src/app/reporting/Engine.h index cff36ff41ccb5b..a16b0d9151d3d9 100644 --- a/src/app/reporting/Engine.h +++ b/src/app/reporting/Engine.h @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -54,7 +55,7 @@ namespace reporting { * At its core, it tries to gather and pack as much relevant attributes changes and/or events as possible into a report * message before sending that to the reader. It continues to do so until it has no more work to do. */ -class Engine +class Engine : public DataModel::ProviderChangeListener { public: /** @@ -140,6 +141,9 @@ class Engine size_t GetGlobalDirtySetSize() { return mGlobalDirtySet.Allocated(); } #endif + /* ProviderChangeListener implementation */ + void MarkDirty(const AttributePathParams & path) override; + private: /** * Main work-horse function that executes the run-loop. diff --git a/src/app/tests/TestWriteInteraction.cpp b/src/app/tests/TestWriteInteraction.cpp index 625d6c3328d2f2..6500b5fe0db6a8 100644 --- a/src/app/tests/TestWriteInteraction.cpp +++ b/src/app/tests/TestWriteInteraction.cpp @@ -15,8 +15,6 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - -#include #include #include @@ -70,9 +68,12 @@ class TestWriteInteraction : public chip::Test::AppContext chip::MutableByteSpan span(buf); ASSERT_EQ(GetBobFabric()->GetCompressedFabricIdBytes(span), CHIP_NO_ERROR); ASSERT_EQ(chip::GroupTesting::InitData(&gGroupsProvider, GetBobFabricIndex(), span), CHIP_NO_ERROR); + + mOldProvider = InteractionModelEngine::GetInstance()->SetDataModelProvider(&TestImCustomDataModel::Instance()); } void TearDown() override { + InteractionModelEngine::GetInstance()->SetDataModelProvider(mOldProvider); chip::Credentials::GroupDataProvider * provider = chip::Credentials::GetGroupDataProvider(); if (provider != nullptr) { @@ -93,6 +94,9 @@ class TestWriteInteraction : public chip::Test::AppContext static void AddAttributeStatus(WriteHandler & aWriteHandler); static void GenerateWriteRequest(bool aIsTimedWrite, System::PacketBufferHandle & aPayload); static void GenerateWriteResponse(System::PacketBufferHandle & aPayload); + +private: + chip::app::DataModel::Provider * mOldProvider = nullptr; }; class TestExchangeDelegate : public Messaging::ExchangeDelegate @@ -296,7 +300,8 @@ TEST_F(TestWriteInteraction, TestWriteHandler) System::PacketBufferHandle buf = System::PacketBufferHandle::New(System::PacketBuffer::kMaxSize); - writeHandler.Init(chip::app::InteractionModelEngine::GetInstance()); + writeHandler.Init(chip::app::InteractionModelEngine::GetInstance()->GetDataModelProvider(), + chip::app::InteractionModelEngine::GetInstance()); GenerateWriteRequest(messageIsTimed, buf); diff --git a/src/app/tests/test-interaction-model-api.cpp b/src/app/tests/test-interaction-model-api.cpp index 4ecc4d66706b0c..d24c586efc2e12 100644 --- a/src/app/tests/test-interaction-model-api.cpp +++ b/src/app/tests/test-interaction-model-api.cpp @@ -46,6 +46,18 @@ class TestOnlyAttributeValueEncoderAccessor AttributeValueEncoder & mEncoder; }; +class TestOnlyAttributeValueDecoderAccessor +{ +public: + TestOnlyAttributeValueDecoderAccessor(AttributeValueDecoder & decoder) : mDecoder(decoder) {} + + TLV::TLVReader & GetTlvReader() { return mDecoder.mReader; } + void SetTriedDecode(bool triedDecode) { mDecoder.mTriedDecode = triedDecode; } + +private: + AttributeValueDecoder & mDecoder; +}; + // Used by the code in TestWriteInteraction.cpp (and generally tests that interact with the WriteHandler may need this). const EmberAfAttributeMetadata * GetAttributeMetadata(const ConcreteAttributePath & aConcreteClusterPath) { @@ -170,7 +182,21 @@ ActionReturnStatus TestImCustomDataModel::ReadAttribute(const ReadAttributeReque ActionReturnStatus TestImCustomDataModel::WriteAttribute(const WriteAttributeRequest & request, AttributeValueDecoder & decoder) { - return CHIP_ERROR_NOT_IMPLEMENTED; + if (request.path.mDataVersion.HasValue() && request.path.mDataVersion.Value() == Test::kRejectedDataVersion) + { + return CHIP_IM_GLOBAL_STATUS(DataVersionMismatch); + } + + TestOnlyAttributeValueDecoderAccessor decodeAccess(decoder); + + decodeAccess.SetTriedDecode(true); + + TLV::TLVWriter writer; + writer.Init(chip::Test::attributeDataTLV); + writer.CopyElement(TLV::AnonymousTag(), decodeAccess.GetTlvReader()); + chip::Test::attributeDataTLVLen = writer.GetLengthWritten(); + + return CHIP_NO_ERROR; } std::optional TestImCustomDataModel::Invoke(const InvokeRequest & request, diff --git a/src/app/util/mock/CodegenEmberMocks.cpp b/src/app/util/mock/CodegenEmberMocks.cpp index 521f36c9569647..a1963ab71d732e 100644 --- a/src/app/util/mock/CodegenEmberMocks.cpp +++ b/src/app/util/mock/CodegenEmberMocks.cpp @@ -15,6 +15,7 @@ * limitations under the License. */ #include +#include #include #include @@ -41,8 +42,13 @@ Status emAfWriteAttributeExternal(const chip::app::ConcreteAttributePath & path, } Status emberAfWriteAttribute(chip::EndpointId endpoint, chip::ClusterId cluster, chip::AttributeId attributeID, uint8_t * dataPtr, - EmberAfAttributeType dataType) + EmberAfAttributeType dataType, chip::app::MarkAttributeDirty markDirty) { return emAfWriteAttributeExternal(chip::app::ConcreteAttributePath(endpoint, cluster, attributeID), EmberAfWriteDataInput(dataPtr, dataType)); } + +Status emberAfWriteAttribute(const chip::app::ConcreteAttributePath & path, const EmberAfWriteDataInput & input) +{ + return emAfWriteAttributeExternal(path, input); +} diff --git a/src/app/util/mock/attribute-storage.cpp b/src/app/util/mock/attribute-storage.cpp index 93d3219fc04a41..87ffa8bbbdd89f 100644 --- a/src/app/util/mock/attribute-storage.cpp +++ b/src/app/util/mock/attribute-storage.cpp @@ -313,6 +313,13 @@ DataVersion * emberAfDataVersionStorage(const chip::app::ConcreteClusterPath & a return &dataVersion; } +void emberAfAttributeChanged(EndpointId endpoint, ClusterId clusterId, AttributeId attributeId, + AttributesChangedListener * listener) +{ + dataVersion++; + listener->MarkDirty(AttributePathParams(endpoint, clusterId, attributeId)); +} + namespace chip { namespace app { diff --git a/src/controller/tests/data_model/DataModelFixtures.cpp b/src/controller/tests/data_model/DataModelFixtures.cpp index 0333b24239e0e7..1850bc0799cdc6 100644 --- a/src/controller/tests/data_model/DataModelFixtures.cpp +++ b/src/controller/tests/data_model/DataModelFixtures.cpp @@ -50,6 +50,17 @@ class TestOnlyAttributeValueEncoderAccessor AttributeValueEncoder & mEncoder; }; +class TestOnlyAttributeValueDecoderAccessor +{ +public: + TestOnlyAttributeValueDecoderAccessor(AttributeValueDecoder & decoder) : mDecoder(decoder) {} + + TLV::TLVReader & GetTlvReader() { return mDecoder.mReader; } + +private: + AttributeValueDecoder & mDecoder; +}; + namespace DataModelTests { ScopedChangeOnly gReadResponseDirective(ReadResponseDirective::kSendDataResponse); @@ -300,7 +311,8 @@ CHIP_ERROR WriteSingleClusterData(const Access::SubjectDescriptor & aSubjectDesc } if (aPath.mClusterId == Clusters::UnitTesting::Id && aPath.mAttributeId == Attributes::ListFabricScoped::Id) { - // Mock a invalid SubjectDescriptor + // Mock an invalid SubjectDescriptor. + // NOTE: completely ignores the passed-in subjectDescriptor AttributeValueDecoder decoder(aReader, Access::SubjectDescriptor()); if (!aPath.IsListOperation() || aPath.mListOp == ConcreteDataAttributePath::ListOperation::ReplaceAll) { @@ -522,7 +534,132 @@ ActionReturnStatus CustomDataModel::ReadAttribute(const ReadAttributeRequest & r ActionReturnStatus CustomDataModel::WriteAttribute(const WriteAttributeRequest & request, AttributeValueDecoder & decoder) { - return CHIP_ERROR_NOT_IMPLEMENTED; + static ListIndex listStructOctetStringElementCount = 0; + + if (request.path.mDataVersion.HasValue() && request.path.mDataVersion.Value() == kRejectedDataVersion) + { + return InteractionModel::Status::DataVersionMismatch; + } + + if (request.path.mClusterId == Clusters::UnitTesting::Id && + request.path.mAttributeId == Attributes::ListStructOctetString::TypeInfo::GetAttributeId()) + { + if (gWriteResponseDirective == WriteResponseDirective::kSendAttributeSuccess) + { + if (!request.path.IsListOperation() || request.path.mListOp == ConcreteDataAttributePath::ListOperation::ReplaceAll) + { + + Attributes::ListStructOctetString::TypeInfo::DecodableType value; + + ReturnErrorOnFailure(decoder.Decode(value)); + + auto iter = value.begin(); + listStructOctetStringElementCount = 0; + while (iter.Next()) + { + auto & item = iter.GetValue(); + + VerifyOrReturnError(item.member1 == listStructOctetStringElementCount, CHIP_ERROR_INVALID_ARGUMENT); + listStructOctetStringElementCount++; + } + return CHIP_NO_ERROR; + } + + if (request.path.mListOp == ConcreteDataAttributePath::ListOperation::AppendItem) + { + Structs::TestListStructOctet::DecodableType item; + ReturnErrorOnFailure(decoder.Decode(item)); + VerifyOrReturnError(item.member1 == listStructOctetStringElementCount, CHIP_ERROR_INVALID_ARGUMENT); + listStructOctetStringElementCount++; + + return CHIP_NO_ERROR; + } + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; + } + + return CHIP_IM_GLOBAL_STATUS(Failure); + } + if (request.path.mClusterId == Clusters::UnitTesting::Id && request.path.mAttributeId == Attributes::ListFabricScoped::Id) + { + // TODO(backwards compatibility): unit tests here undoes the subject descriptor usage + // - original tests were completely bypassing the passed in subject descriptor for this test + // and overriding it with a invalid subject descriptor + // - we do the same here, however this seems somewhat off: decoder.Decode() will fail for list + // items so we could just return the error directly without this extra step + + // Mock an invalid Subject Descriptor + AttributeValueDecoder invalidSubjectDescriptorDecoder(TestOnlyAttributeValueDecoderAccessor(decoder).GetTlvReader(), + Access::SubjectDescriptor()); + if (!request.path.IsListOperation() || request.path.mListOp == ConcreteDataAttributePath::ListOperation::ReplaceAll) + { + Attributes::ListFabricScoped::TypeInfo::DecodableType value; + + ReturnErrorOnFailure(invalidSubjectDescriptorDecoder.Decode(value)); + + auto iter = value.begin(); + while (iter.Next()) + { + auto & item = iter.GetValue(); + (void) item; + } + } + else if (request.path.mListOp == ConcreteDataAttributePath::ListOperation::AppendItem) + { + Structs::TestFabricScoped::DecodableType item; + ReturnErrorOnFailure(invalidSubjectDescriptorDecoder.Decode(item)); + } + else + { + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; + } + return CHIP_NO_ERROR; + } + + // Boolean attribute of unit testing cluster triggers "multiple errors" case. + if (request.path.mClusterId == Clusters::UnitTesting::Id && + request.path.mAttributeId == Attributes::Boolean::TypeInfo::GetAttributeId()) + { + // TODO(IMDM): this used to send 4 responses (hence the multiple status) + // + // for (size_t i = 0; i < 4; ++i) + // { + // aWriteHandler->AddStatus(request.path, status); + // } + // + // which are NOT encodable by a simple response. It is unclear how this is + // convertible (if at all): we write path by path only. Having multiple + // responses for the same path within the write code makes no sense + // + // This should NOT be possible anymore when one can only return a single + // status (nobody has access to multiple path status updates at this level) + switch (gWriteResponseDirective) + { + case WriteResponseDirective::kSendMultipleSuccess: + return InteractionModel::Status::Success; + case WriteResponseDirective::kSendMultipleErrors: + return InteractionModel::Status::Failure; + default: + chipDie(); + } + } + + if (request.path.mClusterId == Clusters::UnitTesting::Id && + request.path.mAttributeId == Attributes::Int8u::TypeInfo::GetAttributeId()) + { + switch (gWriteResponseDirective) + { + case WriteResponseDirective::kSendClusterSpecificSuccess: + return InteractionModel::ClusterStatusCode::ClusterSpecificSuccess(kExampleClusterSpecificSuccess); + case WriteResponseDirective::kSendClusterSpecificFailure: + return InteractionModel::ClusterStatusCode::ClusterSpecificFailure(kExampleClusterSpecificFailure); + default: + // this should not be reached, our tests only set up these for this test case + chipDie(); + } + } + + return CHIP_ERROR_UNSUPPORTED_CHIP_FEATURE; } std::optional CustomDataModel::Invoke(const InvokeRequest & request, chip::TLV::TLVReader & input_arguments, diff --git a/src/controller/tests/data_model/TestWrite.cpp b/src/controller/tests/data_model/TestWrite.cpp index 03d100ab33dabb..218832702b230f 100644 --- a/src/controller/tests/data_model/TestWrite.cpp +++ b/src/controller/tests/data_model/TestWrite.cpp @@ -85,6 +85,19 @@ class SingleWriteCallback : public WriteClient::Callback class TestWrite : public chip::Test::AppContext { public: + void SetUp() override + { + chip::Test::AppContext::SetUp(); + mOldProvider = InteractionModelEngine::GetInstance()->SetDataModelProvider(&CustomDataModel::Instance()); + } + + // Performs teardown for each individual test in the test suite + void TearDown() override + { + InteractionModelEngine::GetInstance()->SetDataModelProvider(mOldProvider); + chip::Test::AppContext::TearDown(); + } + void ResetCallback() { mSingleWriteCallback.reset(); } void PrepareWriteCallback(ConcreteAttributePath path) { mSingleWriteCallback = std::make_unique(path); } @@ -93,6 +106,7 @@ class TestWrite : public chip::Test::AppContext protected: std::unique_ptr mSingleWriteCallback; + chip::app::DataModel::Provider * mOldProvider = nullptr; }; TEST_F(TestWrite, TestDataResponse) @@ -128,7 +142,8 @@ TEST_F(TestWrite, TestDataResponse) DrainAndServiceIO(); - EXPECT_TRUE(onSuccessCbInvoked && !onFailureCbInvoked); + EXPECT_TRUE(onSuccessCbInvoked); + EXPECT_FALSE(onFailureCbInvoked); EXPECT_EQ(chip::app::InteractionModelEngine::GetInstance()->GetNumActiveWriteHandlers(), 0u); EXPECT_EQ(GetExchangeManager().GetNumActiveExchanges(), 0u); } From 010decd199af5bcafb3f5e9c38a5871a5e33ea1a Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Wed, 18 Sep 2024 13:12:52 -0700 Subject: [PATCH 20/47] [Fabric-Admin] Refactor to use API methods instead of PushCommand (1/3) (#35614) * [Fabric-Admin] Refactor to use API methods instead of PushCommand to talk to SDK * Address review comments * Update examples/fabric-admin/device_manager/PairingManager.h Co-authored-by: Andrei Litvin * Update per review comments * Update commissioningTimeout to commissioningTimeoutSec --------- Co-authored-by: Andrei Litvin --- examples/fabric-admin/BUILD.gn | 2 + .../commands/common/CHIPCommand.cpp | 3 + .../fabric-sync/FabricSyncCommand.cpp | 10 +- .../commands/fabric-sync/FabricSyncCommand.h | 2 +- .../OpenCommissioningWindowCommand.cpp | 8 - .../pairing/OpenCommissioningWindowCommand.h | 11 -- .../device_manager/DeviceManager.cpp | 63 ++++--- .../device_manager/DeviceManager.h | 10 +- .../device_manager/PairingManager.cpp | 170 ++++++++++++++++++ .../device_manager/PairingManager.h | 122 +++++++++++++ examples/fabric-admin/rpc/RpcServer.cpp | 29 ++- 11 files changed, 348 insertions(+), 82 deletions(-) create mode 100644 examples/fabric-admin/device_manager/PairingManager.cpp create mode 100644 examples/fabric-admin/device_manager/PairingManager.h diff --git a/examples/fabric-admin/BUILD.gn b/examples/fabric-admin/BUILD.gn index d1add205f8826c..ab584459582657 100644 --- a/examples/fabric-admin/BUILD.gn +++ b/examples/fabric-admin/BUILD.gn @@ -88,6 +88,8 @@ static_library("fabric-admin-utils") { "device_manager/DeviceSubscriptionManager.h", "device_manager/DeviceSynchronization.cpp", "device_manager/DeviceSynchronization.h", + "device_manager/PairingManager.cpp", + "device_manager/PairingManager.h", "device_manager/UniqueIdGetter.cpp", "device_manager/UniqueIdGetter.h", ] diff --git a/examples/fabric-admin/commands/common/CHIPCommand.cpp b/examples/fabric-admin/commands/common/CHIPCommand.cpp index 0c5455439b22d9..b18eb9f2de472a 100644 --- a/examples/fabric-admin/commands/common/CHIPCommand.cpp +++ b/examples/fabric-admin/commands/common/CHIPCommand.cpp @@ -21,6 +21,7 @@ #include "IcdManager.h" #include #include +#include #include #include #include @@ -181,6 +182,8 @@ CHIP_ERROR CHIPCommand::MaybeSetUpStack() mCredIssuerCmds->SetCredentialIssuerOption(CredentialIssuerCommands::CredentialIssuerOptions::kAllowTestCdSigningKey, allowTestCdSigningKey); + PairingManager::Instance().Init(&CurrentCommissioner()); + return CHIP_NO_ERROR; } diff --git a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp index 85a3aada9f88ae..64d43cce11f3ac 100644 --- a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp +++ b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp @@ -344,15 +344,7 @@ CHIP_ERROR FabricSyncDeviceCommand::RunCommand(EndpointId remoteId) return CHIP_NO_ERROR; } - OpenCommissioningWindowCommand * openCommand = - static_cast(CommandMgr().GetCommandByName("pairing", "open-commissioning-window")); - - if (openCommand == nullptr) - { - return CHIP_ERROR_NOT_IMPLEMENTED; - } - - openCommand->RegisterDelegate(this); + PairingManager::Instance().SetOpenCommissioningWindowDelegate(this); DeviceMgr().OpenRemoteDeviceCommissioningWindow(remoteId); diff --git a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.h b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.h index 669edd75d653e6..e80f10133853f7 100644 --- a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.h +++ b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.h @@ -19,8 +19,8 @@ #pragma once #include -#include #include +#include // Constants constexpr uint32_t kCommissionPrepareTimeMs = 500; diff --git a/examples/fabric-admin/commands/pairing/OpenCommissioningWindowCommand.cpp b/examples/fabric-admin/commands/pairing/OpenCommissioningWindowCommand.cpp index 53073160108036..cfe212fda00131 100644 --- a/examples/fabric-admin/commands/pairing/OpenCommissioningWindowCommand.cpp +++ b/examples/fabric-admin/commands/pairing/OpenCommissioningWindowCommand.cpp @@ -70,14 +70,6 @@ CHIP_ERROR OpenCommissioningWindowCommand::RunCommand() void OpenCommissioningWindowCommand::OnOpenCommissioningWindowResponse(void * context, NodeId remoteId, CHIP_ERROR err, chip::SetupPayload payload) { - OpenCommissioningWindowCommand * self = static_cast(context); - if (self->mDelegate) - { - self->mDelegate->OnCommissioningWindowOpened(remoteId, err, payload); - self->UnregisterDelegate(); - } - - LogErrorOnFailure(err); OnOpenBasicCommissioningWindowResponse(context, remoteId, err); } diff --git a/examples/fabric-admin/commands/pairing/OpenCommissioningWindowCommand.h b/examples/fabric-admin/commands/pairing/OpenCommissioningWindowCommand.h index 7edcdba7115665..a8760a464827a9 100644 --- a/examples/fabric-admin/commands/pairing/OpenCommissioningWindowCommand.h +++ b/examples/fabric-admin/commands/pairing/OpenCommissioningWindowCommand.h @@ -22,13 +22,6 @@ #include #include -class CommissioningWindowDelegate -{ -public: - virtual void OnCommissioningWindowOpened(chip::NodeId deviceId, CHIP_ERROR err, chip::SetupPayload payload) = 0; - virtual ~CommissioningWindowDelegate() = default; -}; - class OpenCommissioningWindowCommand : public CHIPCommand { public: @@ -57,9 +50,6 @@ class OpenCommissioningWindowCommand : public CHIPCommand "params if absent"); } - void RegisterDelegate(CommissioningWindowDelegate * delegate) { mDelegate = delegate; } - void UnregisterDelegate() { mDelegate = nullptr; } - /////////// CHIPCommand Interface ///////// CHIP_ERROR RunCommand() override; @@ -71,7 +61,6 @@ class OpenCommissioningWindowCommand : public CHIPCommand NodeId mNodeId; chip::EndpointId mEndpointId; chip::Controller::CommissioningWindowOpener::CommissioningWindowOption mCommissioningWindowOption; - CommissioningWindowDelegate * mDelegate = nullptr; uint16_t mCommissioningWindowTimeout; uint32_t mIteration; uint16_t mDiscriminator; diff --git a/examples/fabric-admin/device_manager/DeviceManager.cpp b/examples/fabric-admin/device_manager/DeviceManager.cpp index ae8fa507ceaaa4..897b1b60e0b68b 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.cpp +++ b/examples/fabric-admin/device_manager/DeviceManager.cpp @@ -20,6 +20,7 @@ #include #include +#include #include #include @@ -30,13 +31,12 @@ using namespace chip::app::Clusters; namespace { -constexpr uint16_t kWindowTimeout = 300; -constexpr uint16_t kIteration = 1000; -constexpr uint16_t kSubscribeMinInterval = 0; -constexpr uint16_t kSubscribeMaxInterval = 60; -constexpr uint16_t kAggragatorEndpointId = 1; -constexpr uint16_t kMaxDiscriminatorLength = 4095; -constexpr uint8_t kEnhancedCommissioningMethod = 1; +constexpr uint16_t kWindowTimeout = 300; +constexpr uint16_t kIteration = 1000; +constexpr uint16_t kSubscribeMinInterval = 0; +constexpr uint16_t kSubscribeMaxInterval = 60; +constexpr uint16_t kAggragatorEndpointId = 1; +constexpr uint16_t kMaxDiscriminatorLength = 4095; } // namespace @@ -115,19 +115,18 @@ void DeviceManager::RemoveSyncedDevice(NodeId nodeId) ChipLogValueX64(device->GetNodeId()), device->GetEndpointId()); } -void DeviceManager::OpenDeviceCommissioningWindow(NodeId nodeId, uint32_t commissioningTimeout, uint32_t iterations, - uint32_t discriminator, const char * saltHex, const char * verifierHex) +void DeviceManager::OpenDeviceCommissioningWindow(NodeId nodeId, uint32_t commissioningTimeoutSec, uint32_t iterations, + uint16_t discriminator, const ByteSpan & salt, const ByteSpan & verifier) { - ChipLogProgress(NotSpecified, "Open the commissioning window of device with NodeId:" ChipLogFormatX64, ChipLogValueX64(nodeId)); + ChipLogProgress(NotSpecified, "Opening commissioning window for Node ID: " ChipLogFormatX64, ChipLogValueX64(nodeId)); // Open the commissioning window of a device within its own fabric. - StringBuilder commandBuilder; - - commandBuilder.Add("pairing open-commissioning-window "); - commandBuilder.AddFormat("%lu %d %d %d %d %d --salt hex:%s --verifier hex:%s", nodeId, kRootEndpointId, - kEnhancedCommissioningMethod, commissioningTimeout, iterations, discriminator, saltHex, verifierHex); - - PushCommand(commandBuilder.c_str()); + CHIP_ERROR err = PairingManager::Instance().OpenCommissioningWindow(nodeId, kRootEndpointId, commissioningTimeoutSec, + iterations, discriminator, salt, verifier); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to open commissioning window: %s", ErrorStr(err)); + } } void DeviceManager::OpenRemoteDeviceCommissioningWindow(EndpointId remoteEndpointId) @@ -135,17 +134,20 @@ void DeviceManager::OpenRemoteDeviceCommissioningWindow(EndpointId remoteEndpoin // Open the commissioning window of a device from another fabric via its fabric bridge. // This method constructs and sends a command to open the commissioning window for a device // that is part of a different fabric, accessed through a fabric bridge. - StringBuilder commandBuilder; // Use random discriminator to have less chance of collision. uint16_t discriminator = Crypto::GetRandU16() % (kMaxDiscriminatorLength + 1); // Include the upper limit kMaxDiscriminatorLength - commandBuilder.Add("pairing open-commissioning-window "); - commandBuilder.AddFormat("%lu %d %d %d %d %d", mRemoteBridgeNodeId, remoteEndpointId, kEnhancedCommissioningMethod, - kWindowTimeout, kIteration, discriminator); + ByteSpan emptySalt; + ByteSpan emptyVerifier; - PushCommand(commandBuilder.c_str()); + CHIP_ERROR err = PairingManager::Instance().OpenCommissioningWindow(mRemoteBridgeNodeId, remoteEndpointId, kWindowTimeout, + kIteration, discriminator, emptySalt, emptyVerifier); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to open commissioning window: %s", ErrorStr(err)); + } } void DeviceManager::PairRemoteFabricBridge(chip::NodeId nodeId, uint32_t setupPINCode, const char * deviceRemoteIp, @@ -421,6 +423,7 @@ void DeviceManager::HandleReverseOpenCommissioningWindow(TLV::TLVReader & data) { CommissionerControl::Commands::ReverseOpenCommissioningWindow::DecodableType value; CHIP_ERROR error = app::DataModel::Decode(data, value); + if (error != CHIP_NO_ERROR) { ChipLogError(NotSpecified, "Failed to decode command response value. Error: %" CHIP_ERROR_FORMAT, error.Format()); @@ -432,18 +435,12 @@ void DeviceManager::HandleReverseOpenCommissioningWindow(TLV::TLVReader & data) ChipLogProgress(NotSpecified, " commissioningTimeout: %u", value.commissioningTimeout); ChipLogProgress(NotSpecified, " discriminator: %u", value.discriminator); ChipLogProgress(NotSpecified, " iterations: %u", value.iterations); + ChipLogProgress(NotSpecified, " PAKEPasscodeVerifier size: %lu", value.PAKEPasscodeVerifier.size()); + ChipLogProgress(NotSpecified, " salt size: %lu", value.salt.size()); - char verifierHex[Crypto::kSpake2p_VerifierSerialized_Length * 2 + 1]; - Encoding::BytesToHex(value.PAKEPasscodeVerifier.data(), value.PAKEPasscodeVerifier.size(), verifierHex, sizeof(verifierHex), - Encoding::HexFlags::kNullTerminate); - ChipLogProgress(NotSpecified, " PAKEPasscodeVerifier: %s", verifierHex); - - char saltHex[Crypto::kSpake2p_Max_PBKDF_Salt_Length * 2 + 1]; - Encoding::BytesToHex(value.salt.data(), value.salt.size(), saltHex, sizeof(saltHex), Encoding::HexFlags::kNullTerminate); - ChipLogProgress(NotSpecified, " salt: %s", saltHex); - - OpenDeviceCommissioningWindow(mLocalBridgeNodeId, value.commissioningTimeout, value.iterations, value.discriminator, saltHex, - verifierHex); + OpenDeviceCommissioningWindow(mLocalBridgeNodeId, value.commissioningTimeout, value.iterations, value.discriminator, + ByteSpan(value.salt.data(), value.salt.size()), + ByteSpan(value.PAKEPasscodeVerifier.data(), value.PAKEPasscodeVerifier.size())); } void DeviceManager::HandleAttributeData(const app::ConcreteDataAttributePath & path, TLV::TLVReader & data) diff --git a/examples/fabric-admin/device_manager/DeviceManager.h b/examples/fabric-admin/device_manager/DeviceManager.h index 5f617845f7dc76..939329be82c691 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.h +++ b/examples/fabric-admin/device_manager/DeviceManager.h @@ -94,18 +94,18 @@ class DeviceManager : public PairingDelegate * This function initiates the process to open the commissioning window for a device identified by the given node ID. * * @param nodeId The ID of the node that should open the commissioning window. - * @param commissioningTimeout The time in seconds before the commissioning window closes. This value determines + * @param commissioningTimeoutSec The time in seconds before the commissioning window closes. This value determines * how long the commissioning window remains open for incoming connections. * @param iterations The number of PBKDF (Password-Based Key Derivation Function) iterations to use * for deriving the PAKE (Password Authenticated Key Exchange) verifier. * @param discriminator The device-specific discriminator, determined during commissioning, which helps * to uniquely identify the device among others. - * @param saltHex The hexadecimal-encoded salt used in the cryptographic operations for commissioning. - * @param verifierHex The hexadecimal-encoded PAKE verifier used to authenticate the commissioning process. + * @param salt The salt used in the cryptographic operations for commissioning. + * @param verifier The PAKE verifier used to authenticate the commissioning process. * */ - void OpenDeviceCommissioningWindow(chip::NodeId nodeId, uint32_t commissioningTimeout, uint32_t iterations, - uint32_t discriminator, const char * saltHex, const char * verifierHex); + void OpenDeviceCommissioningWindow(chip::NodeId nodeId, uint32_t commissioningTimeoutSec, uint32_t iterations, + uint16_t discriminator, const chip::ByteSpan & salt, const chip::ByteSpan & verifier); /** * @brief Open the commissioning window of a device from another fabric via its fabric bridge. diff --git a/examples/fabric-admin/device_manager/PairingManager.cpp b/examples/fabric-admin/device_manager/PairingManager.cpp new file mode 100644 index 00000000000000..aa56af4bc6bf4e --- /dev/null +++ b/examples/fabric-admin/device_manager/PairingManager.cpp @@ -0,0 +1,170 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#include "PairingManager.h" + +#include +#include +#include + +using namespace ::chip; + +PairingManager::PairingManager() : + mOnOpenCommissioningWindowCallback(OnOpenCommissioningWindowResponse, this), + mOnOpenCommissioningWindowVerifierCallback(OnOpenCommissioningWindowVerifierResponse, this) +{} + +void PairingManager::Init(Controller::DeviceCommissioner * commissioner) +{ + VerifyOrDie(mCommissioner == nullptr); + mCommissioner = commissioner; +} + +CHIP_ERROR PairingManager::OpenCommissioningWindow(NodeId nodeId, EndpointId endpointId, uint16_t commissioningTimeoutSec, + uint32_t iterations, uint16_t discriminator, const ByteSpan & salt, + const ByteSpan & verifier) +{ + if (mCommissioner == nullptr) + { + ChipLogError(NotSpecified, "Commissioner is null, cannot open commissioning window"); + return CHIP_ERROR_INCORRECT_STATE; + } + + // Check if a window is already open + if (mWindowOpener != nullptr) + { + ChipLogError(NotSpecified, "A commissioning window is already open"); + return CHIP_ERROR_INCORRECT_STATE; + } + + auto params = Platform::MakeUnique(); + params->nodeId = nodeId; + params->endpointId = endpointId; + params->commissioningWindowTimeout = commissioningTimeoutSec; + params->iteration = iterations; + params->discriminator = discriminator; + + if (!salt.empty()) + { + if (salt.size() > sizeof(params->saltBuffer)) + { + ChipLogError(NotSpecified, "Salt size exceeds buffer capacity"); + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + + memcpy(params->saltBuffer, salt.data(), salt.size()); + params->salt = ByteSpan(params->saltBuffer, salt.size()); + } + + if (!verifier.empty()) + { + if (verifier.size() > sizeof(params->verifierBuffer)) + { + ChipLogError(NotSpecified, "Verifier size exceeds buffer capacity"); + return CHIP_ERROR_BUFFER_TOO_SMALL; + } + + memcpy(params->verifierBuffer, verifier.data(), verifier.size()); + params->verifier = ByteSpan(params->verifierBuffer, verifier.size()); + } + + // Schedule work on the Matter thread + return DeviceLayer::PlatformMgr().ScheduleWork(OnOpenCommissioningWindow, reinterpret_cast(params.release())); +} + +void PairingManager::OnOpenCommissioningWindow(intptr_t context) +{ + Platform::UniquePtr params(reinterpret_cast(context)); + PairingManager & self = PairingManager::Instance(); + + if (self.mCommissioner == nullptr) + { + ChipLogError(NotSpecified, "Commissioner is null, cannot open commissioning window"); + return; + } + + self.mWindowOpener = Platform::MakeUnique(self.mCommissioner); + + if (!params->verifier.empty()) + { + if (params->salt.empty()) + { + ChipLogError(NotSpecified, "Salt is required when verifier is set"); + self.mWindowOpener.reset(); + return; + } + + CHIP_ERROR err = + self.mWindowOpener->OpenCommissioningWindow(Controller::CommissioningWindowVerifierParams() + .SetNodeId(params->nodeId) + .SetEndpointId(params->endpointId) + .SetTimeout(params->commissioningWindowTimeout) + .SetIteration(params->iteration) + .SetDiscriminator(params->discriminator) + .SetVerifier(params->verifier) + .SetSalt(params->salt) + .SetCallback(&self.mOnOpenCommissioningWindowVerifierCallback)); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to open commissioning window with verifier: %s", ErrorStr(err)); + self.mWindowOpener.reset(); + } + } + else + { + SetupPayload ignored; + CHIP_ERROR err = self.mWindowOpener->OpenCommissioningWindow(Controller::CommissioningWindowPasscodeParams() + .SetNodeId(params->nodeId) + .SetEndpointId(params->endpointId) + .SetTimeout(params->commissioningWindowTimeout) + .SetIteration(params->iteration) + .SetDiscriminator(params->discriminator) + .SetSetupPIN(NullOptional) + .SetSalt(NullOptional) + .SetCallback(&self.mOnOpenCommissioningWindowCallback), + ignored); + if (err != CHIP_NO_ERROR) + { + ChipLogError(NotSpecified, "Failed to open commissioning window with passcode: %s", ErrorStr(err)); + self.mWindowOpener.reset(); + } + } +} + +void PairingManager::OnOpenCommissioningWindowResponse(void * context, NodeId remoteId, CHIP_ERROR err, SetupPayload payload) +{ + VerifyOrDie(context != nullptr); + PairingManager * self = static_cast(context); + if (self->mCommissioningWindowDelegate) + { + self->mCommissioningWindowDelegate->OnCommissioningWindowOpened(remoteId, err, payload); + self->SetOpenCommissioningWindowDelegate(nullptr); + } + + OnOpenCommissioningWindowVerifierResponse(context, remoteId, err); +} + +void PairingManager::OnOpenCommissioningWindowVerifierResponse(void * context, NodeId remoteId, CHIP_ERROR err) +{ + VerifyOrDie(context != nullptr); + PairingManager * self = static_cast(context); + LogErrorOnFailure(err); + + // Reset the window opener once the window operation is complete + self->mWindowOpener.reset(); +} diff --git a/examples/fabric-admin/device_manager/PairingManager.h b/examples/fabric-admin/device_manager/PairingManager.h new file mode 100644 index 00000000000000..de1c0887f3b1b7 --- /dev/null +++ b/examples/fabric-admin/device_manager/PairingManager.h @@ -0,0 +1,122 @@ +/* + * + * Copyright (c) 2024 Project CHIP Authors + * All rights reserved. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +#pragma once + +#include +#include +#include + +class CommissioningWindowDelegate +{ +public: + virtual void OnCommissioningWindowOpened(chip::NodeId deviceId, CHIP_ERROR err, chip::SetupPayload payload) = 0; + virtual ~CommissioningWindowDelegate() = default; +}; + +/** + * The PairingManager class is responsible for managing the commissioning and pairing process + * of Matter devices. PairingManager is designed to be used as a singleton, meaning that there + * should only be one instance of it running at any given time. + * + * Usage: + * + * 1. The class should be initialized when the system starts up, typically by invoking the static + * instance method to get the singleton. + * 2. To open a commissioning window, the appropriate method should be called on the PairingManager instance. + * 3. The PairingManager will handle the lifecycle of the CommissioningWindowOpener and ensure that + * resources are cleaned up appropriately when pairing is complete or the process is aborted. + * + * Example: + * + * @code + * PairingManager& manager = PairingManager::Instance(); + * manager.OpenCommissioningWindow(); + * @endcode + */ +class PairingManager +{ +public: + static PairingManager & Instance() + { + static PairingManager instance; + return instance; + } + + void Init(chip::Controller::DeviceCommissioner * commissioner); + + /** + * Opens a commissioning window on the specified node and endpoint. + * Only one commissioning window can be active at a time. If a commissioning + * window is already open, this function will return an error. + * + * @param nodeId The target node ID for commissioning. + * @param endpointId The target endpoint ID for commissioning. + * @param commissioningTimeoutSec Timeout for the commissioning window in seconds. + * @param iterations Iterations for PBKDF calculations. + * @param discriminator Discriminator for commissioning. + * @param salt Optional salt for verifier-based commissioning. + * @param verifier Optional verifier for enhanced commissioning security. + * + * @return CHIP_ERROR_INCORRECT_STATE if a commissioning window is already open. + */ + CHIP_ERROR OpenCommissioningWindow(chip::NodeId nodeId, chip::EndpointId endpointId, uint16_t commissioningTimeoutSec, + uint32_t iterations, uint16_t discriminator, const chip::ByteSpan & salt, + const chip::ByteSpan & verifier); + + void SetOpenCommissioningWindowDelegate(CommissioningWindowDelegate * delegate) { mCommissioningWindowDelegate = delegate; } + +private: + PairingManager(); + PairingManager(const PairingManager &) = delete; + PairingManager & operator=(const PairingManager &) = delete; + + chip::Controller::DeviceCommissioner * mCommissioner = nullptr; + + /////////// Open Commissioning Window Command Interface ///////// + struct CommissioningWindowParams + { + chip::NodeId nodeId; + chip::EndpointId endpointId; + uint16_t commissioningWindowTimeout; + uint32_t iteration; + uint16_t discriminator; + chip::Optional setupPIN; + uint8_t verifierBuffer[chip::Crypto::kSpake2p_VerifierSerialized_Length]; + chip::ByteSpan verifier; + uint8_t saltBuffer[chip::Crypto::kSpake2p_Max_PBKDF_Salt_Length]; + chip::ByteSpan salt; + }; + + CommissioningWindowDelegate * mCommissioningWindowDelegate = nullptr; + + /** + * Holds the unique_ptr to the current CommissioningWindowOpener. + * Only one commissioning window opener can be active at a time. + * The pointer is reset when the commissioning window is closed or when an error occurs. + */ + chip::Platform::UniquePtr mWindowOpener; + + static void OnOpenCommissioningWindow(intptr_t context); + static void OnOpenCommissioningWindowResponse(void * context, chip::NodeId deviceId, CHIP_ERROR status, + chip::SetupPayload payload); + static void OnOpenCommissioningWindowVerifierResponse(void * context, chip::NodeId deviceId, CHIP_ERROR status); + + chip::Callback::Callback mOnOpenCommissioningWindowCallback; + chip::Callback::Callback mOnOpenCommissioningWindowVerifierCallback; +}; diff --git a/examples/fabric-admin/rpc/RpcServer.cpp b/examples/fabric-admin/rpc/RpcServer.cpp index 3fb181eac5f21b..6e5e2ec8d66442 100644 --- a/examples/fabric-admin/rpc/RpcServer.cpp +++ b/examples/fabric-admin/rpc/RpcServer.cpp @@ -86,21 +86,20 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate pw::Status OpenCommissioningWindow(const chip_rpc_DeviceCommissioningWindowInfo & request, chip_rpc_OperationStatus & response) override { - NodeId nodeId = request.node_id; - uint32_t commissioningTimeout = request.commissioning_timeout; - uint32_t iterations = request.iterations; - uint32_t discriminator = request.discriminator; - - char saltHex[Crypto::kSpake2p_Max_PBKDF_Salt_Length * 2 + 1]; - Encoding::BytesToHex(request.salt.bytes, request.salt.size, saltHex, sizeof(saltHex), Encoding::HexFlags::kNullTerminate); - - char verifierHex[Crypto::kSpake2p_VerifierSerialized_Length * 2 + 1]; - Encoding::BytesToHex(request.verifier.bytes, request.verifier.size, verifierHex, sizeof(verifierHex), - Encoding::HexFlags::kNullTerminate); - - ChipLogProgress(NotSpecified, "Received OpenCommissioningWindow request: 0x%lx", nodeId); - - DeviceMgr().OpenDeviceCommissioningWindow(nodeId, commissioningTimeout, iterations, discriminator, saltHex, verifierHex); + NodeId nodeId = request.node_id; + uint32_t commissioningTimeoutSec = request.commissioning_timeout; + uint32_t iterations = request.iterations; + uint16_t discriminator = request.discriminator; + + // Log the request details for debugging + ChipLogProgress(NotSpecified, + "Received OpenCommissioningWindow request: NodeId 0x%lx, Timeout: %u, Iterations: %u, Discriminator: %u", + static_cast(nodeId), commissioningTimeoutSec, iterations, discriminator); + + // Open the device commissioning window using raw binary data for salt and verifier + DeviceMgr().OpenDeviceCommissioningWindow(nodeId, commissioningTimeoutSec, iterations, discriminator, + ByteSpan(request.salt.bytes, request.salt.size), + ByteSpan(request.verifier.bytes, request.verifier.size)); response.success = true; From 0d17a40e6d6028bd7174b6ee5376cdbbc933d855 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Wed, 18 Sep 2024 16:25:58 -0400 Subject: [PATCH 21/47] Disable OpenIOT CI (#35659) --- .github/workflows/examples-openiotsdk.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/examples-openiotsdk.yaml b/.github/workflows/examples-openiotsdk.yaml index bd95868be8028a..579a9d7b4eccee 100644 --- a/.github/workflows/examples-openiotsdk.yaml +++ b/.github/workflows/examples-openiotsdk.yaml @@ -15,11 +15,7 @@ name: Build example - Open IoT SDK on: - push: - branches-ignore: - - 'dependabot/**' - pull_request: - merge_group: + # Workflow disabled due to lack of maintainer workflow_dispatch: concurrency: From 70cfc895e7562798f03e594bacb75ffb908b6770 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Wed, 18 Sep 2024 21:56:01 -0400 Subject: [PATCH 22/47] Remove re-declarations of MTRDeviceController public API on MTRDeviceController_Concrete. (#35653) We should just override whichever selectors we want to override here, instead of re-declaring them all. --- .../CHIP/MTRDeviceController_Concrete.h | 295 ------------------ 1 file changed, 295 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h index 3e83317d8fe780..b491e3f140c85a 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h @@ -17,307 +17,12 @@ #import -#import #import #import -#import - -@class MTRBaseDevice; -@class MTRServerEndpoint; // Defined in MTRServerEndpoint.h, which imports MTRAccessGrant.h, which imports MTRBaseClusters.h, which imports this file, so we can't import it. - -@class MTRDeviceControllerAbstractParameters; NS_ASSUME_NONNULL_BEGIN -MTR_DEPRECATED("Please use MTRBaseDevice deviceWithNodeID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)) -typedef void (^MTRDeviceConnectionCallback)(MTRBaseDevice * _Nullable device, NSError * _Nullable error); - -@class MTRCommissioningParameters; -@class MTRCommissionableBrowserResult; -@class MTRSetupPayload; -@protocol MTRDevicePairingDelegate; -@protocol MTRDeviceControllerDelegate; - @interface MTRDeviceController_Concrete : MTRDeviceController - -/** - * Initialize a device controller with the provided parameters. This will: - * - * 1) Auto-start the MTRDeviceControllerFactory in storage-per-controller mode - * if it has not already been started. - * 2) Return nil or a running controller. - * - * Once this returns non-nil, it's the caller's responsibility to call shutdown - * on the controller to avoid leaking it. - */ -- (nullable MTRDeviceController *)initWithParameters:(MTRDeviceControllerAbstractParameters *)parameters - error:(NSError * __autoreleasing *)error MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)); - -/** - * If true, the controller has not been shut down yet. - */ -@property (readonly, nonatomic, getter=isRunning) BOOL running; - -/** - * Return the Node ID assigned to the controller. Will return nil if the - * controller is not running (and hence does not know its node id). - */ -@property (readonly, nonatomic, nullable) - NSNumber * controllerNodeID MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - -/** - * Set up a commissioning session for a device, using the provided setup payload - * to discover it and connect to it. - * - * @param payload a setup payload (probably created from a QR code or numeric - * code onboarding payload). - * @param newNodeID the planned node id for the node. - * @error error indication if discovery can't start at all (e.g. because the - * setup payload is invalid). - * - * The IP and port for the device will be discovered automatically based on the - * provided discriminator. - * - * Then a PASE session will be established with the device, unless an error - * occurs. MTRDeviceControllerDelegate will be notified as follows: - * - * * Discovery fails: onStatusUpdate with MTRCommissioningStatusFailed. - * - * * Discovery succeeds but commissioning session setup fails: onPairingComplete - * with an error. - * - * * Commissioning session setup succeeds: onPairingComplete with no error. - * - * Once a commissioning session is set up, getDeviceBeingCommissioned - * can be used to get an MTRBaseDevice and discover what sort of network - * credentials the device might need, and commissionDevice can be used to - * commission the device. - */ -- (BOOL)setupCommissioningSessionWithPayload:(MTRSetupPayload *)payload - newNodeID:(NSNumber *)newNodeID - error:(NSError * __autoreleasing *)error - MTR_AVAILABLE(ios(16.2), macos(13.1), watchos(9.2), tvos(16.2)); - -/** - * Set up a commissioning session for a device, using the provided discovered - * result to connect to it. - * - * @param discoveredDevice a previously discovered device. - * @param payload a setup payload (probably created from a QR code or numeric - * code onboarding payload). - * @param newNodeID the planned node id for the node. - * @error error indication if the commissioning session establishment can't start at all. - * - * The connection information for the device will be retrieved from the discovered device. - * A device discovered over DNS-SD will use the discovered IPs/ports, while a device discovered - * over BLE will use the underlying CBPeripheral. - * - * Then a PASE session will be established with the device, unless an error - * occurs. MTRDeviceControllerDelegate will be notified as follows: - * - * * Invalid connection information: onStatusUpdate with MTRCommissioningStatusFailed. - * - * * Commissioning session setup fails: onPairingComplete with an error. - * - * * Commissioning session setup succeeds: onPairingComplete with no error. - * - * Once a commissioning session is set up, getDeviceBeingCommissioned - * can be used to get an MTRBaseDevice and discover what sort of network - * credentials the device might need, and commissionDevice can be used to - * commission the device. - */ -- (BOOL)setupCommissioningSessionWithDiscoveredDevice:(MTRCommissionableBrowserResult *)discoveredDevice - payload:(MTRSetupPayload *)payload - newNodeID:(NSNumber *)newNodeID - error:(NSError * __autoreleasing *)error - MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); - -/** - * Commission the node with the given node ID. The node ID must match the node - * ID that was used to set up the commissioning session. - */ -- (BOOL)commissionNodeWithID:(NSNumber *)nodeID - commissioningParams:(MTRCommissioningParameters *)commissioningParams - error:(NSError * __autoreleasing *)error MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - -/** - * Call this method after MTRDeviceAttestationDelegate - * deviceAttestationFailedForController:opaqueDeviceHandle:error: or - * deviceAttestationCompletedForController:opaqueDeviceHandle:attestationDeviceInfo:error: - * is called to continue commissioning the device. - */ -- (BOOL)continueCommissioningDevice:(void *)opaqueDeviceHandle - ignoreAttestationFailure:(BOOL)ignoreAttestationFailure - error:(NSError * __autoreleasing *)error; - -/** - * Cancel commissioning for the given node id. This will shut down any existing - * commissioning session for that node id. - */ -- (BOOL)cancelCommissioningForNodeID:(NSNumber *)nodeID - error:(NSError * __autoreleasing *)error - MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - -/** - * Get an MTRBaseDevice for a commissioning session that was set up for the - * given node ID. Returns nil if no such commissioning session is available. - */ -- (nullable MTRBaseDevice *)deviceBeingCommissionedWithNodeID:(NSNumber *)nodeID - error:(NSError * __autoreleasing *)error - MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - -- (void)preWarmCommissioningSession MTR_DEPRECATED("-[MTRDeviceControllerFactory preWarmCommissioningSession]", ios(16.4, 17.6), macos(13.3, 14.6), watchos(9.4, 10.6), tvos(16.4, 17.6)); - -// Use super class implementation for -setDeviceControllerDelegate:queue: - -/** - * Start scanning for commissionable devices. - * - * This method will fail if the controller factory is not running or the browse has already been started. - */ -- (BOOL)startBrowseForCommissionables:(id)delegate - queue:(dispatch_queue_t)queue MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); - -/** - * Stop scanning for commissionable devices. - * - * This method will fail if the controller factory is not running or the browse has not been started. - */ -- (BOOL)stopBrowseForCommissionables MTR_AVAILABLE(ios(17.0), macos(14.0), watchos(10.0), tvos(17.0)); - -/** - * Return the attestation challenge for the secure session of the device being commissioned. - * - * Attempts to retrieve the attestation challenge for a commissionee with the given Device ID. - * Returns nil if given Device ID does not match an active commissionee, or if a Secure Session is not availale. - */ -- (NSData * _Nullable)attestationChallengeForDeviceID:(NSNumber *)deviceID - MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - -/** - * Add a server endpoint for this controller. The endpoint starts off enabled. - * - * Will fail in the following cases: - * - * 1) There is already an endpoint defined with the given endpoint id. - * 2) There are too many endpoints defined already. - */ -- (BOOL)addServerEndpoint:(MTRServerEndpoint *)endpoint MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)); - -/** - * Remove the given server endpoint from this controller. If the endpoint is - * not attached to this controller, will just call the completion and do nothing - * else. - */ -- (void)removeServerEndpoint:(MTRServerEndpoint *)endpoint queue:(dispatch_queue_t)queue completion:(dispatch_block_t)completion MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)); - -/** - * Remove the given server endpoint without being notified when the removal - * completes. - */ -- (void)removeServerEndpoint:(MTRServerEndpoint *)endpoint MTR_AVAILABLE(ios(17.6), macos(14.6), watchos(10.6), tvos(17.6)); - -/** - * Compute a PASE verifier for the desired setup passcode. - * - * @param[in] setupPasscode The desired passcode to use. - * @param[in] iterations The number of iterations to use when generating the verifier. - * @param[in] salt The 16-byte salt for verifier computation. - * - * Returns nil on errors (e.g. salt has the wrong size), otherwise the computed - * verifier bytes. - */ -+ (nullable NSData *)computePASEVerifierForSetupPasscode:(NSNumber *)setupPasscode - iterations:(NSNumber *)iterations - salt:(NSData *)salt - error:(NSError * __autoreleasing *)error - MTR_AVAILABLE(ios(16.4), macos(13.3), watchos(9.4), tvos(16.4)); - -/** - * Shut down the controller. Calls to shutdown after the first one are NO-OPs. - * This must be called, either directly or via shutting down the - * MTRDeviceControllerFactory, to avoid leaking the controller. - */ -- (void)shutdown; - -@end - -@interface MTRDeviceController_Concrete (Deprecated) - -@property (readonly, nonatomic, nullable) NSNumber * controllerNodeId MTR_DEPRECATED( - "Please use controllerNodeID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - -- (nullable NSData *)fetchAttestationChallengeForDeviceId:(uint64_t)deviceId - MTR_DEPRECATED( - "Please use attestationChallengeForDeviceID", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - -- (BOOL)getBaseDevice:(uint64_t)deviceID - queue:(dispatch_queue_t)queue - completionHandler:(MTRDeviceConnectionCallback)completionHandler - MTR_DEPRECATED("Please use [MTRBaseDevice deviceWithNodeID:controller:]", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), - tvos(16.1, 16.4)); - -- (BOOL)pairDevice:(uint64_t)deviceID - discriminator:(uint16_t)discriminator - setupPINCode:(uint32_t)setupPINCode - error:(NSError * __autoreleasing *)error - MTR_DEPRECATED("Please use setupCommissioningSessionWithPayload:newNodeID:error:", ios(16.1, 16.4), macos(13.0, 13.3), - watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (BOOL)pairDevice:(uint64_t)deviceID - address:(NSString *)address - port:(uint16_t)port - setupPINCode:(uint32_t)setupPINCode - error:(NSError * __autoreleasing *)error - MTR_DEPRECATED("Please use setupCommissioningSessionWithPayload:newNodeID:error:", ios(16.1, 16.4), macos(13.0, 13.3), - watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (BOOL)pairDevice:(uint64_t)deviceID - onboardingPayload:(NSString *)onboardingPayload - error:(NSError * __autoreleasing *)error - MTR_DEPRECATED("Please use setupCommissioningSessionWithPayload:newNodeID:error:", ios(16.1, 16.4), macos(13.0, 13.3), - watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (BOOL)commissionDevice:(uint64_t)deviceId - commissioningParams:(MTRCommissioningParameters *)commissioningParams - error:(NSError * __autoreleasing *)error - MTR_DEPRECATED("Please use commissionNodeWithID:commissioningParams:error:", ios(16.1, 16.4), macos(13.0, 13.3), - watchos(9.1, 9.4), tvos(16.1, 16.4)); - -- (BOOL)stopDevicePairing:(uint64_t)deviceID - error:(NSError * __autoreleasing *)error - MTR_DEPRECATED( - "Please use cancelCommissioningForNodeID:error:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - -- (nullable MTRBaseDevice *)getDeviceBeingCommissioned:(uint64_t)deviceId - error:(NSError * __autoreleasing *)error - MTR_DEPRECATED("Please use deviceBeingCommissionedWithNodeID:error:", ios(16.1, 16.4), macos(13.0, 13.3), watchos(9.1, 9.4), - tvos(16.1, 16.4)); - -- (BOOL)openPairingWindow:(uint64_t)deviceID - duration:(NSUInteger)duration - error:(NSError * __autoreleasing *)error - MTR_DEPRECATED("Please use MTRDevice or MTRBaseDevice openCommissioningWindowWithSetupPasscode", ios(16.1, 16.4), - macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); -- (nullable NSString *)openPairingWindowWithPIN:(uint64_t)deviceID - duration:(NSUInteger)duration - discriminator:(NSUInteger)discriminator - setupPIN:(NSUInteger)setupPIN - error:(NSError * __autoreleasing *)error - MTR_DEPRECATED("Please use MTRDevice or MTRBaseDevice openCommissioningWindowWithSetupPasscode", ios(16.1, 16.4), - macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - -- (nullable NSData *)computePaseVerifier:(uint32_t)setupPincode - iterations:(uint32_t)iterations - salt:(NSData *)salt - MTR_DEPRECATED("Please use computePASEVerifierForSetupPasscode:iterations:salt:error:", ios(16.1, 16.4), macos(13.0, 13.3), - watchos(9.1, 9.4), tvos(16.1, 16.4)); - -- (void)setPairingDelegate:(id)delegate - queue:(dispatch_queue_t)queue MTR_DEPRECATED("Please use setDeviceControllerDelegate:", ios(16.1, 16.4), - macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); - -- (void)setNocChainIssuer:(id)nocChainIssuer - queue:(dispatch_queue_t)queue - MTR_DEPRECATED("Please set the operationalCertificateIssuer in the MTRDeviceControllerStartupParams instead.", ios(16.1, 16.4), - macos(13.0, 13.3), watchos(9.1, 9.4), tvos(16.1, 16.4)); @end NS_ASSUME_NONNULL_END From 5dc91f3273a55fe991624b68ada8fb50b64c913a Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Wed, 18 Sep 2024 23:01:23 -0700 Subject: [PATCH 23/47] Clean up fabric sync log files upon exit to ensure a new log file is generated during the next run. (#35655) * Cleanup fabric sync log files after exit * Address review comment * Restyled by whitespace --------- Co-authored-by: Restyled.io --- examples/fabric-admin/scripts/stop_fabric_sync.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/examples/fabric-admin/scripts/stop_fabric_sync.sh b/examples/fabric-admin/scripts/stop_fabric_sync.sh index faa5c79ce211b6..a03e188b5eb0c6 100755 --- a/examples/fabric-admin/scripts/stop_fabric_sync.sh +++ b/examples/fabric-admin/scripts/stop_fabric_sync.sh @@ -21,4 +21,7 @@ fi # Remove /tmp/chip_* files and directories rm -rf /tmp/chip_* -echo "Removed /tmp/chip_* files and directories" +echo "Removed /tmp/chip_* files and directories." +rm /tmp/fabric_admin.log +rm /tmp/fabric_bridge_app.log +echo "Removed fabric sync log files." From 3663d4253010e2c56fef7cdbdc95e86cb504e023 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 19 Sep 2024 02:50:14 -0400 Subject: [PATCH 24/47] Clean up the "subclasses must implement this" machinery in MTRDevice. (#35657) * Clean up the "subclasses must implement this" machinery in MTRDevice. We had a lot of copy/paste that we can factor out. * Address review comments. --- .../Framework/CHIP/MTRDefines_Internal.h | 14 ++++++++ src/darwin/Framework/CHIP/MTRDevice.mm | 35 +++---------------- 2 files changed, 19 insertions(+), 30 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDefines_Internal.h b/src/darwin/Framework/CHIP/MTRDefines_Internal.h index 14683f34c553f9..5a450ece8ec7f3 100644 --- a/src/darwin/Framework/CHIP/MTRDefines_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDefines_Internal.h @@ -152,3 +152,17 @@ typedef struct {} variable_hidden_by_mtr_hide; #endif #define MTR_YES_NO(x) ((x) ? @"YES" : @"NO") + +#ifdef DEBUG +#define _MTR_ABSTRACT_METHOD_IMPL(message, ...) \ + do { \ + MTR_LOG_ERROR(message, __VA_ARGS__); \ + @throw [NSException exceptionWithName:NSInternalInconsistencyException reason:[NSString stringWithFormat:@message, __VA_ARGS__] userInfo:nil]; \ + } while (0) +#else // DEBUG +#define _MTR_ABSTRACT_METHOD_IMPL(message, ...) \ + MTR_LOG_ERROR(message, __VA_ARGS__) +#endif // DEBUG + +#define MTR_ABSTRACT_METHOD() \ + _MTR_ABSTRACT_METHOD_IMPL("%@ or some ancestor must implement %@", self.class, NSStringFromSelector(_cmd)) diff --git a/src/darwin/Framework/CHIP/MTRDevice.mm b/src/darwin/Framework/CHIP/MTRDevice.mm index 46fc8faa40ee1d..cabcb448ec348e 100644 --- a/src/darwin/Framework/CHIP/MTRDevice.mm +++ b/src/darwin/Framework/CHIP/MTRDevice.mm @@ -1248,12 +1248,7 @@ - (NSUInteger)unitTestNonnullDelegateCount attributeID:(NSNumber *)attributeID params:(MTRReadParams * _Nullable)params { -#define MTRDeviceErrorStr "MTRDevice readAttributeWithEndpointID:clusterID:attributeID:params: must be handled by subclasses" - MTR_LOG_ERROR(MTRDeviceErrorStr); -#ifdef DEBUG - NSAssert(NO, @MTRDeviceErrorStr); -#endif // DEBUG -#undef MTRDeviceErrorStr + MTR_ABSTRACT_METHOD(); return nil; } @@ -1264,22 +1259,12 @@ - (void)writeAttributeWithEndpointID:(NSNumber *)endpointID expectedValueInterval:(NSNumber *)expectedValueInterval timedWriteTimeout:(NSNumber * _Nullable)timeout { -#define MTRDeviceErrorStr "MTRDevice writeAttributeWithEndpointID:clusterID:attributeID:value:expectedValueInterval:timedWriteTimeout: must be handled by subclasses" - MTR_LOG_ERROR(MTRDeviceErrorStr); -#ifdef DEBUG - NSAssert(NO, @MTRDeviceErrorStr); -#endif // DEBUG -#undef MTRDeviceErrorStr + MTR_ABSTRACT_METHOD(); } - (NSArray *> *)readAttributePaths:(NSArray *)attributePaths { -#define MTRDeviceErrorStr "MTRDevice readAttributePaths: must be handled by subclasses" - MTR_LOG_ERROR(MTRDeviceErrorStr); -#ifdef DEBUG - NSAssert(NO, @MTRDeviceErrorStr); -#endif // DEBUG -#undef MTRDeviceErrorStr + MTR_ABSTRACT_METHOD(); return [NSArray array]; } @@ -1362,12 +1347,7 @@ - (void)_invokeCommandWithEndpointID:(NSNumber *)endpointID queue:(dispatch_queue_t)queue completion:(MTRDeviceResponseHandler)completion { -#define MTRDeviceErrorStr "MTRDevice _invokeCommandWithEndpointID: must be handled by subclasses" - MTR_LOG_ERROR(MTRDeviceErrorStr); -#ifdef DEBUG - NSAssert(NO, @MTRDeviceErrorStr); -#endif // DEBUG -#undef MTRDeviceErrorStr + MTR_ABSTRACT_METHOD(); } - (void)_invokeKnownCommandWithEndpointID:(NSNumber *)endpointID @@ -1476,12 +1456,7 @@ - (NSDictionary *)_dataValueWithoutDataVersion:(NSDictionary *)attributeValue - (NSArray *> *)getAllAttributesReport { -#define MTRDeviceErrorStr "MTRDevice getAllAttributesReport must be handled by subclasses that support it" - MTR_LOG_ERROR(MTRDeviceErrorStr); -#ifdef DEBUG - NSAssert(NO, @MTRDeviceErrorStr); -#endif // DEBUG -#undef MTRDeviceErrorStr + MTR_ABSTRACT_METHOD(); return nil; } From 884d9fa1e55dad79599538301ad708c86ef31cfb Mon Sep 17 00:00:00 2001 From: Yufeng Wang Date: Thu, 19 Sep 2024 00:43:33 -0700 Subject: [PATCH 25/47] Cleanup extra namespace prefix (#35664) --- .../fabric-sync/FabricSyncCommand.cpp | 2 +- .../OpenCommissioningWindowCommand.cpp | 2 +- .../commands/pairing/PairingCommand.cpp | 54 +++++++++---------- .../device_manager/DeviceManager.cpp | 6 +-- .../device_manager/DeviceSubscription.cpp | 2 +- .../DeviceSubscriptionManager.cpp | 2 +- .../device_manager/DeviceSynchronization.cpp | 10 ++-- .../device_manager/UniqueIdGetter.cpp | 4 +- examples/fabric-admin/rpc/RpcClient.cpp | 4 +- examples/fabric-admin/rpc/RpcServer.cpp | 10 ++-- 10 files changed, 46 insertions(+), 50 deletions(-) diff --git a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp index 64d43cce11f3ac..6e1b198ad9e924 100644 --- a/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp +++ b/examples/fabric-admin/commands/fabric-sync/FabricSyncCommand.cpp @@ -274,7 +274,7 @@ CHIP_ERROR FabricSyncRemoveLocalBridgeCommand::RunCommand() return CHIP_NO_ERROR; } -void FabricSyncDeviceCommand::OnCommissioningWindowOpened(NodeId deviceId, CHIP_ERROR err, chip::SetupPayload payload) +void FabricSyncDeviceCommand::OnCommissioningWindowOpened(NodeId deviceId, CHIP_ERROR err, SetupPayload payload) { ChipLogProgress(NotSpecified, "FabricSyncDeviceCommand::OnCommissioningWindowOpened"); diff --git a/examples/fabric-admin/commands/pairing/OpenCommissioningWindowCommand.cpp b/examples/fabric-admin/commands/pairing/OpenCommissioningWindowCommand.cpp index cfe212fda00131..b7e36ca2e1352d 100644 --- a/examples/fabric-admin/commands/pairing/OpenCommissioningWindowCommand.cpp +++ b/examples/fabric-admin/commands/pairing/OpenCommissioningWindowCommand.cpp @@ -68,7 +68,7 @@ CHIP_ERROR OpenCommissioningWindowCommand::RunCommand() } void OpenCommissioningWindowCommand::OnOpenCommissioningWindowResponse(void * context, NodeId remoteId, CHIP_ERROR err, - chip::SetupPayload payload) + SetupPayload payload) { OnOpenBasicCommissioningWindowResponse(context, remoteId, err); } diff --git a/examples/fabric-admin/commands/pairing/PairingCommand.cpp b/examples/fabric-admin/commands/pairing/PairingCommand.cpp index c9b58cd92f83ee..2e1cec184c2e3e 100644 --- a/examples/fabric-admin/commands/pairing/PairingCommand.cpp +++ b/examples/fabric-admin/commands/pairing/PairingCommand.cpp @@ -169,7 +169,7 @@ CommissioningParameters PairingCommand::GetCommissioningParameters() if (!mICDSymmetricKey.HasValue()) { - chip::Crypto::DRBG_get_bytes(mRandomGeneratedICDSymmetricKey, sizeof(mRandomGeneratedICDSymmetricKey)); + Crypto::DRBG_get_bytes(mRandomGeneratedICDSymmetricKey, sizeof(mRandomGeneratedICDSymmetricKey)); mICDSymmetricKey.SetValue(ByteSpan(mRandomGeneratedICDSymmetricKey)); } if (!mICDCheckInNodeId.HasValue()) @@ -296,7 +296,7 @@ CHIP_ERROR PairingCommand::PairWithMdnsOrBleByIndexWithCode(NodeId remoteId, uin // There is no device with this index that has some resolution data. This could simply // be because the device is a ble device. In this case let's fall back to looking for // a device with this index and some RendezvousParameters. - chip::SetupPayload payload; + SetupPayload payload; bool isQRCode = strncmp(mOnboardingPayload, kQRCodePrefix, strlen(kQRCodePrefix)) == 0; if (isQRCode) { @@ -336,21 +336,21 @@ CHIP_ERROR PairingCommand::PairWithMdns(NodeId remoteId) Dnssd::DiscoveryFilter filter(mFilterType); switch (mFilterType) { - case chip::Dnssd::DiscoveryFilterType::kNone: + case Dnssd::DiscoveryFilterType::kNone: break; - case chip::Dnssd::DiscoveryFilterType::kShortDiscriminator: - case chip::Dnssd::DiscoveryFilterType::kLongDiscriminator: - case chip::Dnssd::DiscoveryFilterType::kCompressedFabricId: - case chip::Dnssd::DiscoveryFilterType::kVendorId: - case chip::Dnssd::DiscoveryFilterType::kDeviceType: + case Dnssd::DiscoveryFilterType::kShortDiscriminator: + case Dnssd::DiscoveryFilterType::kLongDiscriminator: + case Dnssd::DiscoveryFilterType::kCompressedFabricId: + case Dnssd::DiscoveryFilterType::kVendorId: + case Dnssd::DiscoveryFilterType::kDeviceType: filter.code = mDiscoveryFilterCode; break; - case chip::Dnssd::DiscoveryFilterType::kCommissioningMode: + case Dnssd::DiscoveryFilterType::kCommissioningMode: break; - case chip::Dnssd::DiscoveryFilterType::kCommissioner: + case Dnssd::DiscoveryFilterType::kCommissioner: filter.code = 1; break; - case chip::Dnssd::DiscoveryFilterType::kInstanceName: + case Dnssd::DiscoveryFilterType::kInstanceName: filter.code = 0; filter.instanceName = mDiscoveryFilterInstanceName; break; @@ -480,10 +480,10 @@ void PairingCommand::OnReadCommissioningInfo(const Controller::ReadCommissioning void PairingCommand::OnICDRegistrationComplete(ScopedNodeId nodeId, uint32_t icdCounter) { - char icdSymmetricKeyHex[chip::Crypto::kAES_CCM128_Key_Length * 2 + 1]; + char icdSymmetricKeyHex[Crypto::kAES_CCM128_Key_Length * 2 + 1]; - chip::Encoding::BytesToHex(mICDSymmetricKey.Value().data(), mICDSymmetricKey.Value().size(), icdSymmetricKeyHex, - sizeof(icdSymmetricKeyHex), chip::Encoding::HexFlags::kNullTerminate); + Encoding::BytesToHex(mICDSymmetricKey.Value().data(), mICDSymmetricKey.Value().size(), icdSymmetricKeyHex, + sizeof(icdSymmetricKeyHex), Encoding::HexFlags::kNullTerminate); app::ICDClientInfo clientInfo; clientInfo.peer_node = nodeId; @@ -521,7 +521,7 @@ void PairingCommand::OnICDStayActiveComplete(ScopedNodeId deviceId, uint32_t pro ChipLogValueX64(deviceId.GetNodeId()), promisedActiveDuration); } -void PairingCommand::OnDiscoveredDevice(const chip::Dnssd::CommissionNodeData & nodeData) +void PairingCommand::OnDiscoveredDevice(const Dnssd::CommissionNodeData & nodeData) { // Ignore nodes with closed commissioning window VerifyOrReturn(nodeData.commissioningMode != 0); @@ -529,7 +529,7 @@ void PairingCommand::OnDiscoveredDevice(const chip::Dnssd::CommissionNodeData & auto & resolutionData = nodeData; const uint16_t port = resolutionData.port; - char buf[chip::Inet::IPAddress::kMaxStringLength]; + char buf[Inet::IPAddress::kMaxStringLength]; resolutionData.ipAddress[0].ToString(buf); ChipLogProgress(NotSpecified, "Discovered Device: %s:%u", buf, port); @@ -566,8 +566,7 @@ void PairingCommand::OnCurrentFabricRemove(void * context, NodeId nodeId, CHIP_E fprintf(stderr, "Device with Node ID: 0x%lx has been successfully removed.\n", nodeId); #if defined(PW_RPC_ENABLED) - chip::app::InteractionModelEngine::GetInstance()->ShutdownSubscriptions(command->CurrentCommissioner().GetFabricIndex(), - nodeId); + app::InteractionModelEngine::GetInstance()->ShutdownSubscriptions(command->CurrentCommissioner().GetFabricIndex(), nodeId); RemoveSynchronizedDevice(nodeId); #endif } @@ -586,10 +585,10 @@ void PairingCommand::OnCurrentFabricRemove(void * context, NodeId nodeId, CHIP_E command->SetCommandExitStatus(err); } -chip::Optional PairingCommand::FailSafeExpiryTimeoutSecs() const +Optional PairingCommand::FailSafeExpiryTimeoutSecs() const { // No manual input, so do not need to extend. - return chip::Optional(); + return Optional(); } bool PairingCommand::ShouldWaitAfterDeviceAttestation() @@ -603,10 +602,9 @@ bool PairingCommand::ShouldWaitAfterDeviceAttestation() return err == CHIP_NO_ERROR && (payload.vendorID != 0 || payload.productID != 0); } -void PairingCommand::OnDeviceAttestationCompleted(chip::Controller::DeviceCommissioner * deviceCommissioner, - chip::DeviceProxy * device, - const chip::Credentials::DeviceAttestationVerifier::AttestationDeviceInfo & info, - chip::Credentials::AttestationVerificationResult attestationResult) +void PairingCommand::OnDeviceAttestationCompleted(Controller::DeviceCommissioner * deviceCommissioner, DeviceProxy * device, + const Credentials::DeviceAttestationVerifier::AttestationDeviceInfo & info, + Credentials::AttestationVerificationResult attestationResult) { SetupPayload payload; CHIP_ERROR parse_error = GetPayload(mOnboardingPayload, payload); @@ -619,7 +617,7 @@ void PairingCommand::OnDeviceAttestationCompleted(chip::Controller::DeviceCommis "Requested VID: %u, Requested PID: %u.", payload.vendorID, payload.productID); deviceCommissioner->ContinueCommissioningAfterDeviceAttestation( - device, chip::Credentials::AttestationVerificationResult::kInvalidArgument); + device, Credentials::AttestationVerificationResult::kInvalidArgument); return; } @@ -633,8 +631,8 @@ void PairingCommand::OnDeviceAttestationCompleted(chip::Controller::DeviceCommis deviceCommissioner->ContinueCommissioningAfterDeviceAttestation( device, payload.vendorID == info.BasicInformationVendorId() - ? chip::Credentials::AttestationVerificationResult::kDacProductIdMismatch - : chip::Credentials::AttestationVerificationResult::kDacVendorIdMismatch); + ? Credentials::AttestationVerificationResult::kDacProductIdMismatch + : Credentials::AttestationVerificationResult::kDacVendorIdMismatch); return; } @@ -654,7 +652,7 @@ void PairingCommand::OnDeviceAttestationCompleted(chip::Controller::DeviceCommis { // Bypass attestation verification, continue with success auto err = deviceCommissioner->ContinueCommissioningAfterDeviceAttestation( - device, chip::Credentials::AttestationVerificationResult::kSuccess); + device, Credentials::AttestationVerificationResult::kSuccess); if (CHIP_NO_ERROR != err) { SetCommandExitStatus(err); diff --git a/examples/fabric-admin/device_manager/DeviceManager.cpp b/examples/fabric-admin/device_manager/DeviceManager.cpp index 897b1b60e0b68b..f34a8443feaa68 100644 --- a/examples/fabric-admin/device_manager/DeviceManager.cpp +++ b/examples/fabric-admin/device_manager/DeviceManager.cpp @@ -150,7 +150,7 @@ void DeviceManager::OpenRemoteDeviceCommissioningWindow(EndpointId remoteEndpoin } } -void DeviceManager::PairRemoteFabricBridge(chip::NodeId nodeId, uint32_t setupPINCode, const char * deviceRemoteIp, +void DeviceManager::PairRemoteFabricBridge(NodeId nodeId, uint32_t setupPINCode, const char * deviceRemoteIp, uint16_t deviceRemotePort) { StringBuilder commandBuilder; @@ -240,7 +240,7 @@ void DeviceManager::ReadSupportedDeviceCategories() PushCommand(commandBuilder.c_str()); } -void DeviceManager::HandleReadSupportedDeviceCategories(chip::TLV::TLVReader & data) +void DeviceManager::HandleReadSupportedDeviceCategories(TLV::TLVReader & data) { ChipLogProgress(NotSpecified, "Attribute SupportedDeviceCategories detected."); @@ -305,7 +305,7 @@ void DeviceManager::HandleCommissioningRequestResult(TLV::TLVReader & data) SendCommissionNodeRequest(value.requestID, kResponseTimeoutSeconds); } -void DeviceManager::HandleAttributePartsListUpdate(chip::TLV::TLVReader & data) +void DeviceManager::HandleAttributePartsListUpdate(TLV::TLVReader & data) { ChipLogProgress(NotSpecified, "Attribute PartsList change detected:"); diff --git a/examples/fabric-admin/device_manager/DeviceSubscription.cpp b/examples/fabric-admin/device_manager/DeviceSubscription.cpp index e83eda282c476b..c41f73e0464cd3 100644 --- a/examples/fabric-admin/device_manager/DeviceSubscription.cpp +++ b/examples/fabric-admin/device_manager/DeviceSubscription.cpp @@ -85,7 +85,7 @@ void DeviceSubscription::OnAttributeData(const ConcreteDataAttributePath & path, } case Clusters::AdministratorCommissioning::Attributes::AdminVendorId::Id: { #if defined(PW_RPC_ENABLED) - chip::VendorId vendorId; + VendorId vendorId; CHIP_ERROR err = data->Get(vendorId); mCurrentAdministratorCommissioningAttributes.has_opener_vendor_id = err == CHIP_NO_ERROR; if (mCurrentAdministratorCommissioningAttributes.has_opener_vendor_id) diff --git a/examples/fabric-admin/device_manager/DeviceSubscriptionManager.cpp b/examples/fabric-admin/device_manager/DeviceSubscriptionManager.cpp index b485806bef6292..8dd43f28751591 100644 --- a/examples/fabric-admin/device_manager/DeviceSubscriptionManager.cpp +++ b/examples/fabric-admin/device_manager/DeviceSubscriptionManager.cpp @@ -53,7 +53,7 @@ CHIP_ERROR DeviceSubscriptionManager::StartSubscription(Controller::DeviceContro return CHIP_NO_ERROR; } -CHIP_ERROR DeviceSubscriptionManager::RemoveSubscription(chip::NodeId nodeId) +CHIP_ERROR DeviceSubscriptionManager::RemoveSubscription(NodeId nodeId) { assertChipStackLockedByCurrentThread(); auto it = mDeviceSubscriptionMap.find(nodeId); diff --git a/examples/fabric-admin/device_manager/DeviceSynchronization.cpp b/examples/fabric-admin/device_manager/DeviceSynchronization.cpp index cbf84e23d0b2ed..e70a968d726280 100644 --- a/examples/fabric-admin/device_manager/DeviceSynchronization.cpp +++ b/examples/fabric-admin/device_manager/DeviceSynchronization.cpp @@ -138,7 +138,7 @@ void DeviceSynchronizer::OnReportEnd() MoveToState(State::ReceivedResponse); } -void DeviceSynchronizer::OnDone(chip::app::ReadClient * apReadClient) +void DeviceSynchronizer::OnDone(app::ReadClient * apReadClient) { #if defined(PW_RPC_ENABLED) if (mState == State::ReceivedResponse && !DeviceMgr().IsCurrentBridgeDevice(mNodeId)) @@ -163,8 +163,7 @@ void DeviceSynchronizer::OnError(CHIP_ERROR error) ChipLogProgress(NotSpecified, "Error fetching device data: %" CHIP_ERROR_FORMAT, error.Format()); } -void DeviceSynchronizer::OnDeviceConnected(chip::Messaging::ExchangeManager & exchangeMgr, - const chip::SessionHandle & sessionHandle) +void DeviceSynchronizer::OnDeviceConnected(Messaging::ExchangeManager & exchangeMgr, const SessionHandle & sessionHandle) { mClient = std::make_unique(app::InteractionModelEngine::GetInstance(), &exchangeMgr /* echangeMgr */, *this /* callback */, ReadClient::InteractionType::Read); @@ -188,14 +187,13 @@ void DeviceSynchronizer::OnDeviceConnected(chip::Messaging::ExchangeManager & ex MoveToState(State::AwaitingResponse); } -void DeviceSynchronizer::OnDeviceConnectionFailure(const chip::ScopedNodeId & peerId, CHIP_ERROR error) +void DeviceSynchronizer::OnDeviceConnectionFailure(const ScopedNodeId & peerId, CHIP_ERROR error) { ChipLogError(NotSpecified, "Device Sync failed to connect to " ChipLogFormatX64, ChipLogValueX64(peerId.GetNodeId())); MoveToState(State::Idle); } -void DeviceSynchronizer::StartDeviceSynchronization(chip::Controller::DeviceController * controller, chip::NodeId nodeId, - bool deviceIsIcd) +void DeviceSynchronizer::StartDeviceSynchronization(Controller::DeviceController * controller, NodeId nodeId, bool deviceIsIcd) { VerifyOrDie(controller); if (mState != State::Idle) diff --git a/examples/fabric-admin/device_manager/UniqueIdGetter.cpp b/examples/fabric-admin/device_manager/UniqueIdGetter.cpp index 3aba21752d9c67..9c59e54137bf2b 100644 --- a/examples/fabric-admin/device_manager/UniqueIdGetter.cpp +++ b/examples/fabric-admin/device_manager/UniqueIdGetter.cpp @@ -53,8 +53,8 @@ UniqueIdGetter::UniqueIdGetter() : mOnDeviceConnectionFailureCallback(OnDeviceConnectionFailureWrapper, this) {} -CHIP_ERROR UniqueIdGetter::GetUniqueId(OnDoneCallback onDoneCallback, chip::Controller::DeviceController & controller, - chip::NodeId nodeId, chip::EndpointId endpointId) +CHIP_ERROR UniqueIdGetter::GetUniqueId(OnDoneCallback onDoneCallback, Controller::DeviceController & controller, NodeId nodeId, + EndpointId endpointId) { assertChipStackLockedByCurrentThread(); VerifyOrDie(!mCurrentlyGettingUid); diff --git a/examples/fabric-admin/rpc/RpcClient.cpp b/examples/fabric-admin/rpc/RpcClient.cpp index df7a475071c4ba..9d094a6e102566 100644 --- a/examples/fabric-admin/rpc/RpcClient.cpp +++ b/examples/fabric-admin/rpc/RpcClient.cpp @@ -144,7 +144,7 @@ CHIP_ERROR AddSynchronizedDevice(const chip_rpc_SynchronizedDevice & data) return WaitForResponse(call); } -CHIP_ERROR RemoveSynchronizedDevice(chip::NodeId nodeId) +CHIP_ERROR RemoveSynchronizedDevice(NodeId nodeId) { ChipLogProgress(NotSpecified, "RemoveSynchronizedDevice"); @@ -164,7 +164,7 @@ CHIP_ERROR RemoveSynchronizedDevice(chip::NodeId nodeId) return WaitForResponse(call); } -CHIP_ERROR ActiveChanged(chip::NodeId nodeId, uint32_t promisedActiveDurationMs) +CHIP_ERROR ActiveChanged(NodeId nodeId, uint32_t promisedActiveDurationMs) { ChipLogProgress(NotSpecified, "ActiveChanged"); diff --git a/examples/fabric-admin/rpc/RpcServer.cpp b/examples/fabric-admin/rpc/RpcServer.cpp index 6e5e2ec8d66442..d5e072305fe0dc 100644 --- a/examples/fabric-admin/rpc/RpcServer.cpp +++ b/examples/fabric-admin/rpc/RpcServer.cpp @@ -45,7 +45,7 @@ namespace { class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate { public: - void OnCheckInCompleted(const chip::app::ICDClientInfo & clientInfo) override + void OnCheckInCompleted(const app::ICDClientInfo & clientInfo) override { // Accessing mPendingCheckIn should only be done while holding ChipStackLock assertChipStackLockedByCurrentThread(); @@ -76,7 +76,7 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate // addressed, we can implement what spec defines here. auto onDone = [=](uint32_t promisedActiveDuration) { ActiveChanged(nodeId, promisedActiveDuration); }; CHIP_ERROR err = StayActiveSender::SendStayActiveCommand(checkInData.mStayActiveDurationMs, clientInfo.peer_node, - chip::app::InteractionModelEngine::GetInstance(), onDone); + app::InteractionModelEngine::GetInstance(), onDone); if (err != CHIP_NO_ERROR) { ChipLogError(NotSpecified, "Failed to send StayActive command %s", err.AsString()); @@ -156,7 +156,7 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate KeepActiveWorkData * data = Platform::New(this, request.node_id, request.stay_active_duration_ms, request.timeout_ms); VerifyOrReturnValue(data, pw::Status::Internal()); - chip::DeviceLayer::PlatformMgr().ScheduleWork(KeepActiveWork, reinterpret_cast(data)); + DeviceLayer::PlatformMgr().ScheduleWork(KeepActiveWork, reinterpret_cast(data)); return pw::OkStatus(); } @@ -194,7 +194,7 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate {} FabricAdmin * mFabricAdmin; - chip::NodeId mNodeId; + NodeId mNodeId; uint32_t mStayActiveDurationMs; uint32_t mTimeoutMs; }; @@ -203,7 +203,7 @@ class FabricAdmin final : public rpc::FabricAdmin, public IcdManager::Delegate { KeepActiveWorkData * data = reinterpret_cast(arg); data->mFabricAdmin->ScheduleSendingKeepActiveOnCheckIn(data->mNodeId, data->mStayActiveDurationMs, data->mTimeoutMs); - chip::Platform::Delete(data); + Platform::Delete(data); } // Modifications to mPendingCheckIn should be done on the MatterEventLoop thread From 1428332248822caca56468295eedd4fe96adb5d4 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Thu, 19 Sep 2024 14:24:16 +0200 Subject: [PATCH 26/47] [Logging] Use the ephemeral initiator node id in the logging message when the responder transmit a message (#35654) --- src/transport/SessionManager.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/transport/SessionManager.cpp b/src/transport/SessionManager.cpp index 82287339117182..d68a5f3e6e6480 100644 --- a/src/transport/SessionManager.cpp +++ b/src/transport/SessionManager.cpp @@ -332,6 +332,10 @@ CHIP_ERROR SessionManager::PrepareMessage(const SessionHandle & sessionHandle, P #if CHIP_PROGRESS_LOGGING destination = kUndefinedNodeId; fabricIndex = kUndefinedFabricIndex; + if (session->GetSessionRole() == Transport::UnauthenticatedSession::SessionRole::kResponder) + { + destination = session->GetEphemeralInitiatorNodeID(); + } #endif // CHIP_PROGRESS_LOGGING } break; From fe96fa1bda907977a39fc969c26be45e58a3edc8 Mon Sep 17 00:00:00 2001 From: pankore <86098180+pankore@users.noreply.github.com> Date: Thu, 19 Sep 2024 20:24:57 +0800 Subject: [PATCH 27/47] [Ameba] add platform app task (#35640) * add platform app task for all-clusters-app --- examples/all-clusters-app/ameba/main/chipinterface.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/examples/all-clusters-app/ameba/main/chipinterface.cpp b/examples/all-clusters-app/ameba/main/chipinterface.cpp index 5bf20befc73107..7d06e72c094ecb 100644 --- a/examples/all-clusters-app/ameba/main/chipinterface.cpp +++ b/examples/all-clusters-app/ameba/main/chipinterface.cpp @@ -24,6 +24,9 @@ #include "Globals.h" #include "LEDWidget.h" #include "chip_porting.h" +#if CHIP_AMEBA_APP_TASK +#include "ameba_main_task.h" +#endif #include #include @@ -170,7 +173,9 @@ static void InitServer(intptr_t context) #if CONFIG_ENABLE_CHIP_SHELL InitBindingHandler(); #endif - +#if CHIP_AMEBA_APP_TASK + AppTaskInit(); +#endif chip::Server::GetInstance().GetFabricTable().AddFabricDelegate(&sAmebaObserver); } From 7862cb34f7a9d639ee8a70b62fbe6c62a8e49afc Mon Sep 17 00:00:00 2001 From: lpbeliveau-silabs <112982107+lpbeliveau-silabs@users.noreply.github.com> Date: Thu, 19 Sep 2024 08:32:29 -0400 Subject: [PATCH 28/47] Updated TC_S_2_4 to match VS doc (#35585) --- .../suites/certification/Test_TC_S_2_4.yaml | 78 +++++++++++++++++-- 1 file changed, 71 insertions(+), 7 deletions(-) diff --git a/src/app/tests/suites/certification/Test_TC_S_2_4.yaml b/src/app/tests/suites/certification/Test_TC_S_2_4.yaml index 196d08a4eb46cf..cd10315f1e3ed7 100644 --- a/src/app/tests/suites/certification/Test_TC_S_2_4.yaml +++ b/src/app/tests/suites/certification/Test_TC_S_2_4.yaml @@ -165,7 +165,14 @@ tests: "Step 4a: TH configures AC1 on DUT for all implemented application clusters supporting scenes." verification: | - Is DUT configured with AC1? + ./chip-tool levelcontrol move-to-level-with-on-off 100 0 0 0 1 1 + + DUT is configured with AC1 for application clusters which is implemented and supporting scenes + + [1705040301.476123][6423:6425] CHIP:DMG: StatusIB = + [1705040301.476139][6423:6425] CHIP:DMG: { + [1705040301.476152][6423:6425] CHIP:DMG: status = 0x00 (SUCCESS), + [1705040301.476164][6423:6425] CHIP:DMG: }, cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -237,7 +244,14 @@ tests: "Step 5a: TH configures AC2 on DUT for all implemented application clusters supporting scenes." verification: | - Is DUT configured with AC2? + ./chip-tool levelcontrol move-to-level-with-on-off 200 0 0 0 1 1 + + DUT is configured with AC2 for application clusters which is implemented, supporting scenes and different from AC1 + + [1705040820.918043][6555:6557] CHIP:DMG: StatusIB = + [1705040820.918056][6555:6557] CHIP:DMG: { + [1705040820.918068][6555:6557] CHIP:DMG: status = 0x00 (SUCCESS), + [1705040820.918080][6555:6557] CHIP:DMG: }, cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -282,7 +296,19 @@ tests: - label: "DUT transitions to AC1 over 20s." verification: | - Is the transition done over 20s? + DUT transitions to AC1 over 20s. + + TH confirm the DUT reached AC1 (on level control cluster) after 20s + + Read CurrentLevel attribute from level control cluster + + ./chip-tool levelcontrol read current-level 1 1 + + Verify CurrentLevel attribute value on TH(chip-tool) + + [1708072116.730389][7757:7759] CHIP:DMG: } + [1708072116.730518][7757:7759] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0008 Attribute 0x0000_0000 DataVersion: 2359286215 + [1708072116.730552][7757:7759] CHIP:TOO: CurrentLevel: 100 cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -314,7 +340,14 @@ tests: "Step 6a: TH configures AC2 on DUT for all implemented application clusters supporting scenes." verification: | - Is DUT configured with AC2? + ./chip-tool levelcontrol move-to-level-with-on-off 200 0 0 0 1 1 + + DUT is configured with AC2 for application clusters which is implemented, supporting scenes and different from AC1 + + [1705040820.918043][6555:6557] CHIP:DMG: StatusIB = + [1705040820.918056][6555:6557] CHIP:DMG: { + [1705040820.918068][6555:6557] CHIP:DMG: status = 0x00 (SUCCESS), + [1705040820.918080][6555:6557] CHIP:DMG: }, cluster: "LogCommands" command: "UserPrompt" PICS: S.S.C05.Rsp && PICS_SKIP_SAMPLE_APP @@ -362,7 +395,19 @@ tests: - label: "DUT transitions to AC1 over 5." verification: | - Is the transition done over 5s? + DUT transitions to AC1 over 5s. + + TH confirm the DUT reached AC1 (on level control cluster) after 5s + + Read CurrentLevel attribute from level control cluster + + ./chip-tool levelcontrol read current-level 1 1 + + Verify CurrentLevel attribute value on TH(chip-tool) + + [1708072116.730389][7757:7759] CHIP:DMG: } + [1708072116.730518][7757:7759] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0008 Attribute 0x0000_0000 DataVersion: 2359286215 + [1708072116.730552][7757:7759] CHIP:TOO: CurrentLevel: 100 cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -394,7 +439,14 @@ tests: "Step 7a: TH configures AC2 on DUT for all implemented application clusters supporting scenes." verification: | - Is DUT configured with AC2? + ./chip-tool levelcontrol move-to-level-with-on-off 200 0 0 0 1 1 + + DUT is configured with AC2 for application clusters which is implemented, supporting scenes and different from AC1 + + [1705040820.918043][6555:6557] CHIP:DMG: StatusIB = + [1705040820.918056][6555:6557] CHIP:DMG: { + [1705040820.918068][6555:6557] CHIP:DMG: status = 0x00 (SUCCESS), + [1705040820.918080][6555:6557] CHIP:DMG: }, cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP @@ -442,7 +494,19 @@ tests: - label: "DUT transitions to AC1 over 20s." verification: | - Is the transition done over 20s? + DUT transitions to AC1 over 20s. + + TH confirm the DUT reached AC1 (on level control cluster) after 20s + + Read CurrentLevel attribute from level control cluster + + ./chip-tool levelcontrol read current-level 1 1 + + Verify CurrentLevel attribute value on TH(chip-tool) + + [1708072116.730389][7757:7759] CHIP:DMG: } + [1708072116.730518][7757:7759] CHIP:TOO: Endpoint: 1 Cluster: 0x0000_0008 Attribute 0x0000_0000 DataVersion: 2359286215 + [1708072116.730552][7757:7759] CHIP:TOO: CurrentLevel: 100 cluster: "LogCommands" command: "UserPrompt" PICS: PICS_SKIP_SAMPLE_APP From afb1a331227269b74cf64dce35e450dae1297227 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Thu, 19 Sep 2024 16:28:29 +0200 Subject: [PATCH 29/47] Tracing: Create leading directories if they don't exist (#35668) --- src/controller/python/chip/tracing/TracingSetup.cpp | 2 +- src/controller/python/chip/tracing/__init__.py | 3 --- src/tracing/json/json_tracing.cpp | 11 ++++++++++- src/tracing/perfetto/file_output.cpp | 9 +++++++++ 4 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/controller/python/chip/tracing/TracingSetup.cpp b/src/controller/python/chip/tracing/TracingSetup.cpp index 73e0633b3bf373..76e9ac1527de06 100644 --- a/src/controller/python/chip/tracing/TracingSetup.cpp +++ b/src/controller/python/chip/tracing/TracingSetup.cpp @@ -34,7 +34,7 @@ chip::Tracing::Perfetto::PerfettoBackend gPerfettoBackend; } // namespace -extern "C" void pychip_tracing_start_json_log(const char * file_name) +extern "C" void pychip_tracing_start_json_log() { chip::MainLoopWork::ExecuteInMainLoop([] { gJsonBackend.CloseFile(); // just in case, ensure no file output diff --git a/src/controller/python/chip/tracing/__init__.py b/src/controller/python/chip/tracing/__init__.py index fc6ee35f3b1bb9..1d2add7f0b5522 100644 --- a/src/controller/python/chip/tracing/__init__.py +++ b/src/controller/python/chip/tracing/__init__.py @@ -115,9 +115,6 @@ def StartFromString(self, destination: str): else: raise ValueError("Invalid trace-to destination: %r", destination) - def __init__(self): - pass - def __enter__(self): return self diff --git a/src/tracing/json/json_tracing.cpp b/src/tracing/json/json_tracing.cpp index 4531740b81a193..e719f1f6dc12a5 100644 --- a/src/tracing/json/json_tracing.cpp +++ b/src/tracing/json/json_tracing.cpp @@ -31,6 +31,7 @@ #include +#include #include #include @@ -461,8 +462,16 @@ void JsonBackend::CloseFile() CHIP_ERROR JsonBackend::OpenFile(const char * path) { CloseFile(); - mOutputFile.open(path, std::ios_base::out); + std::error_code ec; + std::filesystem::path filePath(path); + // Create directories if they don't exist + if (!std::filesystem::create_directories(filePath.remove_filename(), ec)) + { + return CHIP_ERROR_POSIX(ec.value()); + } + + mOutputFile.open(path, std::ios_base::out); if (!mOutputFile) { return CHIP_ERROR_POSIX(errno); diff --git a/src/tracing/perfetto/file_output.cpp b/src/tracing/perfetto/file_output.cpp index d9ac3e87781a3c..b54d11d9ae3c28 100644 --- a/src/tracing/perfetto/file_output.cpp +++ b/src/tracing/perfetto/file_output.cpp @@ -24,6 +24,7 @@ #include #include +#include namespace chip { namespace Tracing { @@ -37,6 +38,14 @@ CHIP_ERROR FileTraceOutput::Open(const char * file_name) // Close any existing files Close(); + std::error_code ec; + std::filesystem::path filePath(file_name); + // Create directories if they don't exist + if (!std::filesystem::create_directories(filePath.remove_filename(), ec)) + { + return CHIP_ERROR_POSIX(ec.value()); + } + // Create a trace file and start sending data to it mTraceFileId = open(file_name, O_RDWR | O_CREAT | O_TRUNC, 0640); if (mTraceFileId < 0) From 6b121dd64319238f79370f117fd6689783cd3647 Mon Sep 17 00:00:00 2001 From: dinabenamar <108664279+dinabenamar@users.noreply.github.com> Date: Thu, 19 Sep 2024 17:38:17 +0200 Subject: [PATCH 30/47] [NXP] Adding pre/post-build process support for NXP RW61x platform (#35448) * [NXP][config][zephyr] Allow factory data to be generated outside "zephyr" folder in order to share the generation process with freertos Signed-off-by: Dina Benamar * [NXP][config][freertos] Adding support to build applications and execute pre/post-build processes with cmake wrappers Signed-off-by: Dina Benamar * [NXP][examples][rw61x] Adding support to build applications with cmake (this method is using wrappers which call the gn build command) * Adding configs for build & pre/post-build processes Signed-off-by: Dina Benamar * [NXP][scripts][build_examples] Adding support to build applications with cmake using build_examples.py as the entry-point for RW61x Signed-off-by: Dina Benamar * [NXP][scripts][build_examples] Adding differentiator to support both gn and cmake build systems Signed-off-by: Dina Benamar * Restyled by autopep8 * Restyled by isort * [NXP][script][build_examples] Adding board variant enum Signed-off-by: Dina Benamar * [NXP] Adding setup requirements to the list requirements.nxp.txt Signed-off-by: Dina Benamar * Restyled by autopep8 * [NXP] Updating nxp_matter_support submodule Signed-off-by: Dina Benamar * Restyled by autopep8 * Update scripts/build/builders/nxp.py Co-authored-by: Andrei Litvin * Update scripts/build/builders/nxp.py Co-authored-by: Andrei Litvin * Update scripts/build/builders/nxp.py Co-authored-by: Andrei Litvin --------- Signed-off-by: Dina Benamar Co-authored-by: Restyled.io Co-authored-by: Andrei Litvin --- .github/workflows/examples-nxp.yaml | 1 + config/nxp/chip-cmake-freertos/CMakeLists.txt | 77 +++++++-- .../chip-module/generate_factory_data.cmake | 4 +- .../nxp/rt/rw61x/CMakeLists.txt | 38 +++++ .../nxp/rt/rw61x/platform_config.cmake | 110 ++++++++++++ .../thermostat/nxp/rt/rw61x/CMakeLists.txt | 38 +++++ scripts/build/build/targets.py | 5 +- scripts/build/builders/nxp.py | 156 ++++++++++++++---- .../build/testdata/all_targets_linux_x64.txt | 2 +- scripts/setup/requirements.nxp.txt | 9 +- third_party/nxp/nxp_matter_support | 2 +- 11 files changed, 391 insertions(+), 51 deletions(-) create mode 100644 examples/all-clusters-app/nxp/rt/rw61x/CMakeLists.txt create mode 100644 examples/platform/nxp/rt/rw61x/platform_config.cmake create mode 100644 examples/thermostat/nxp/rt/rw61x/CMakeLists.txt diff --git a/.github/workflows/examples-nxp.yaml b/.github/workflows/examples-nxp.yaml index 83506c6c070cb8..fc929eff2601c0 100644 --- a/.github/workflows/examples-nxp.yaml +++ b/.github/workflows/examples-nxp.yaml @@ -243,6 +243,7 @@ jobs: --target nxp-rw61x-freertos-all-clusters-wifi \ --target nxp-rw61x-freertos-all-clusters-thread \ --target nxp-rw61x-freertos-all-clusters-thread-wifi \ + --target nxp-rw61x-freertos-all-clusters-wifi-ota-cmake \ build \ --copy-artifacts-to out/artifacts \ " diff --git a/config/nxp/chip-cmake-freertos/CMakeLists.txt b/config/nxp/chip-cmake-freertos/CMakeLists.txt index db078e69df4f64..27bedc50ae53a9 100644 --- a/config/nxp/chip-cmake-freertos/CMakeLists.txt +++ b/config/nxp/chip-cmake-freertos/CMakeLists.txt @@ -20,16 +20,24 @@ if(NOT CHIP_ROOT) get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_SOURCE_DIR}/../../.. REALPATH) endif() -get_filename_component(GN_ROOT_TARGET ${CHIP_ROOT}/config/nxp/chip-gn-freertos REALPATH) +if (NOT GN_ROOT_TARGET) + get_filename_component(GN_ROOT_TARGET ${CHIP_ROOT}/config/nxp/chip-gn-freertos REALPATH) +endif() + +# Include common NXP helpers for build & pre/post-build process +include(${CHIP_ROOT}/third_party/nxp/nxp_matter_support/cmake/build_helpers.cmake) include(${CHIP_ROOT}/config/nxp/cmake/common.cmake) include(${CHIP_ROOT}/src/app/chip_data_model.cmake) +if(NOT CONFIG_CHIP_BUILD_APP_WITH_GN) # Prepare compiler flags matter_add_cflags(${CMAKE_C_FLAGS}) matter_add_cxxflags(${CMAKE_CXX_FLAGS}) matter_get_compiler_flags_from_targets("${CONFIG_CHIP_EXTERNAL_TARGETS}") +endif() + # ============================================================================== # Generate configuration for CHIP GN build system @@ -39,6 +47,8 @@ matter_add_gn_arg_string("nxp_platform" ${CONFIG_CHIP_NXP_PLATFORM}) matter_add_gn_arg("chip_with_factory_data" ${CONFIG_CHIP_FACTORY_DATA}) matter_add_gn_arg("chip_enable_secure_dac_private_key_storage" ${CONFIG_CHIP_SECURE_DAC_PRIVATE_KEY_STORAGE}) matter_add_gn_arg("chip_enable_secure_whole_factory_data" ${CONFIG_CHIP_ENABLE_SECURE_WHOLE_FACTORY_DATA}) +matter_add_gn_arg_bool("chip_enable_matter_cli" CONFIG_CHIP_LIB_SHELL) +matter_add_gn_arg_bool("chip_enable_pairing_autostart" CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART) if (CONFIG_USE_CHIP_DATA_MODEL_INTERFACE) set(DATA_MODEL_INTERFACE "enabled") @@ -46,24 +56,71 @@ else() set(DATA_MODEL_INTERFACE "disabled") endif() -matter_common_gn_args( - DEBUG CONFIG_DEBUG - LIB_SHELL CONFIG_CHIP_LIB_SHELL - LIB_TESTS CONFIG_CHIP_BUILD_TESTS - PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG} - PROJECT_CONFIG_INC_DIR ${CONFIG_CHIP_PROJECT_CONFIG_INCLUDE_DIRS} - DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER - DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE} -) +if(CONFIG_BOOTLOADER_MCUBOOT) + matter_add_gn_arg_bool("no_mcuboot" false) +endif(CONFIG_BOOTLOADER_MCUBOOT) + +# Enable map file generation by default +matter_add_gn_arg_bool("chip_generate_link_map_file" true) + +if(CONFIG_CHIP_BUILD_APP_WITH_GN) + include(${CHIP_ROOT}/third_party/nxp/nxp_matter_support/cmake/nxp_sdk_gn_build.cmake) +else() + matter_common_gn_args( + DEBUG CONFIG_DEBUG + LIB_SHELL CONFIG_CHIP_LIB_SHELL + LIB_TESTS CONFIG_CHIP_BUILD_TESTS + PROJECT_CONFIG ${CONFIG_CHIP_PROJECT_CONFIG} + PROJECT_CONFIG_INC_DIR ${CONFIG_CHIP_PROJECT_CONFIG_INCLUDE_DIRS} + DEVICE_INFO_EXAMPLE_PROVIDER CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER + DATA_MODEL_INTERFACE ${DATA_MODEL_INTERFACE} + ) +endif() matter_generate_args_tmp_file() # ============================================================================== # Build chip library # ============================================================================== +if(NOT CONFIG_CHIP_BUILD_APP_WITH_GN) matter_build(chip LIB_SHELL ${CONFIG_CHIP_LIB_SHELL} LIB_TESTS ${CONFIG_CHIP_BUILD_TESTS} DEVICE_INFO_EXAMPLE_PROVIDER ${CONFIG_CHIP_EXAMPLE_DEVICE_INFO_PROVIDER} GN_DEPENDENCIES ${CONFIG_GN_DEPENDENCIES} ) +endif() + + +#************************************************************************************** +# Pre-build instructions +#************************************************************************************** +nxp_pre_build_process() + +#************************************************************************************** +# Post-build instructions +#************************************************************************************** +if(CONFIG_CHIP_OTA_REQUESTOR) + +if (CONFIG_BOOTLOADER_MCUBOOT) + # Build mcuboot application + nxp_generate_mcuboot() + + # Sign application binaries with mcuboot imgtool + nxp_sign_app_imgtool("${CONFIG_REMOVE_SECTIONS_FROM_BIN}") + +endif() + + # Generate .ota file + nxp_generate_ota_file() + +endif(CONFIG_CHIP_OTA_REQUESTOR) + +if (CONFIG_CHIP_FACTORY_DATA_BUILD) + + set(OUTPUT_FILE_PATH ${gn_build}/factory_data) + + # Generate factory data binaries + nxp_generate_factory_data() + +endif(CONFIG_CHIP_FACTORY_DATA_BUILD) diff --git a/config/nxp/chip-module/generate_factory_data.cmake b/config/nxp/chip-module/generate_factory_data.cmake index ea1e35a797ab78..4a4cb25243dc6b 100644 --- a/config/nxp/chip-module/generate_factory_data.cmake +++ b/config/nxp/chip-module/generate_factory_data.cmake @@ -218,7 +218,9 @@ function(nxp_generate_factory_data) # Localize all scripts needed to generate factory data partition set(GENERATE_CERTS_SCRIPT_PATH ${CHIP_ROOT}/scripts/tools/nxp/generate_certs.py) set(GENERATE_FDATA_SCRIPT_PATH ${CHIP_ROOT}/scripts/tools/nxp/factory_data_generator/generate.py) - set(OUTPUT_FILE_PATH ${APPLICATION_BINARY_DIR}/zephyr) + if (NOT OUTPUT_FILE_PATH) + set(OUTPUT_FILE_PATH ${APPLICATION_BINARY_DIR}/zephyr) + endif() if(CONFIG_CHIP_FACTORY_DATA_CERT_SOURCE_GENERATED) # Generate certificates diff --git a/examples/all-clusters-app/nxp/rt/rw61x/CMakeLists.txt b/examples/all-clusters-app/nxp/rt/rw61x/CMakeLists.txt new file mode 100644 index 00000000000000..58ac1da0913811 --- /dev/null +++ b/examples/all-clusters-app/nxp/rt/rw61x/CMakeLists.txt @@ -0,0 +1,38 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +cmake_minimum_required(VERSION 3.13.1) + +project(chip-rw61x-all-cluster-example) + +if (NOT CHIP_ROOT) + get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_LIST_DIR}/../../../../.. REALPATH) +endif() + +# Define the GN root target for the application +get_filename_component(GN_ROOT_TARGET ${CMAKE_CURRENT_LIST_DIR} REALPATH) + +# Include platform specific configs / variables +include(${CHIP_ROOT}/examples/platform/nxp/rt/rw61x/platform_config.cmake) + +add_subdirectory(${CHIP_ROOT}/config/nxp/chip-cmake-freertos ./chip) + +#************************************************************************************** +# Build example application +#************************************************************************************** +if(CONFIG_CHIP_BUILD_APP_WITH_GN) + nxp_build_app_with_gn() +endif() diff --git a/examples/platform/nxp/rt/rw61x/platform_config.cmake b/examples/platform/nxp/rt/rw61x/platform_config.cmake new file mode 100644 index 00000000000000..52138944fdc270 --- /dev/null +++ b/examples/platform/nxp/rt/rw61x/platform_config.cmake @@ -0,0 +1,110 @@ + +# +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +# +# @file +# CMake file that defines cmake variables specific to this platform +# + +# Board configs +set(CONFIG_CORE_FOLDER "") + +if (CONFIG_BOARD_VARIANT STREQUAL "frdm") + set(CONFIG_BOARD_NAME "frdmrw612") +else() + set(CONFIG_BOARD_NAME "rdrw612bga") +endif() + +# MCUBoot OTA configs +set(CONFIG_MCUBOOT_BUILD_TYPE "flash_release") +set(CONFIG_CHIP_MCUBOOT_SLOT_SIZE 0x440000) +set(CONFIG_CHIP_MCUBOOT_MAX_SECTORS 1088) +set(CONFIG_CHIP_MCUBOOT_HEADER_SIZE 0x1000) + +# CHIP configs +set(CONFIG_CHIP_DEVICE_VENDOR_ID 4151) +set(CONFIG_CHIP_DEVICE_PRODUCT_ID 41510) + +set(CONFIG_CHIP_DEVICE_VENDOR_NAME "NXP Semiconductors") +if (NOT CONFIG_CHIP_DEVICE_PRODUCT_NAME) + set(CONFIG_CHIP_DEVICE_PRODUCT_NAME "Thermostat") +endif() +if (NOT CONFIG_CHIP_DEVICE_TYPE) + set(CONFIG_CHIP_DEVICE_TYPE 769) +endif() +set(CONFIG_CHIP_DEVICE_SPAKE2_IT 10000) +set(CONFIG_CHIP_DEVICE_SPAKE2_SALT "UXKLzwHdN3DZZLBaL2iVGhQi/OoQwIwJRQV4rpEalbA=") +if (NOT CONFIG_CHIP_DEVICE_DISCRIMINATOR) + set(CONFIG_CHIP_DEVICE_DISCRIMINATOR 2560) +endif() +if (NOT CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE) + set(CONFIG_CHIP_DEVICE_SPAKE2_PASSCODE 14014) +endif() +set(CONFIG_CHIP_DEVICE_HARDWARE_VERSION 1) +set(CONFIG_CHIP_DEVICE_HARDWARE_VERSION_STRING "1.0") +set(CONFIG_CHIP_DEVICE_SERIAL_NUMBER "12345678") +set(CONFIG_CHIP_DEVICE_MANUFACTURING_DATE "2024-01-01") +set(CONFIG_CHIP_DEVICE_ROTATING_DEVICE_UID "00112233445566778899aabbccddeeff") +set(CONFIG_CHIP_DEVICE_PRODUCT_FINISH "Matte") +set(CONFIG_CHIP_DEVICE_PRODUCT_COLOR "Green") +set(CONFIG_CHIP_DEVICE_PRODUCT_URL "https://www.nxp.com/products/wireless/wi-fi-plus-bluetooth-plus-802-15-4/wireless-mcu-with-integrated-tri-radiobr1x1-wi-fi-6-plus-bluetooth-low-energy-5-3-802-15-4:RW612") +set(CONFIG_CHIP_DEVICE_PRODUCT_LABEL "RW612") +set(CONFIG_CHIP_DEVICE_PART_NUMBER "RW612") +set(CONFIG_CHIP_ENCRYPTED_FACTORY_DATA_AES128_KEY "2B7E151628AED2A6ABF7158809CF4F3C") +set(CONFIG_CHIP_FACTORY_DATA_CERT_SOURCE_GENERATED true) +set(CONFIG_CHIP_FACTORY_DATA_GENERATE_SPAKE2_VERIFIER true) +set(CONFIG_CHIP_ENCRYPTED_FACTORY_DATA true) + +# build configs +set(CONFIG_CHIP_NVM_COMPONENT "nvs") +set(CONFIG_CHIP_RT_PLATFORM "rw61x") +set(CONFIG_CHIP_NXP_PLATFORM "rt/${CONFIG_CHIP_RT_PLATFORM}") +set(CONFIG_CHIP_FACTORY_DATA 1) +set(CONFIG_CHIP_SECURE_DAC_PRIVATE_KEY_STORAGE false) +set(CONFIG_CHIP_ENABLE_SECURE_WHOLE_FACTORY_DATA false) +set(CONFIG_CHIP_BUILD_APP_WITH_GN true) +set(CONFIG_LOG true) +set(CONFIG_MATTER_LOG_LEVEL 4) # detail logs + +# BLE is enabled by default +if (NOT DEFINED CONFIG_BT) + set(CONFIG_BT true) +endif() + +if (NOT DEFINED CONFIG_CHIP_IPV4) + set(CONFIG_CHIP_IPV4 true) +endif() + +if (NOT DEFINED CONFIG_CHIP_DEVICE_SOFTWARE_VERSION) + set(CONFIG_CHIP_DEVICE_SOFTWARE_VERSION 1) +endif() + +if (NOT DEFINED CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING) + set(CONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING "1.0") +endif() + +if(NOT DEFINED CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART) + set(CONFIG_CHIP_ENABLE_PAIRING_AUTOSTART true) +endif() + + +# define sections to remove from the binary when converting the elf to bin with objcopy +if (CONFIG_CHIP_OTA_REQUESTOR) + set(CONFIG_REMOVE_SECTIONS_FROM_BIN -R .flash_config -R .NVM) +else() + set(CONFIG_REMOVE_SECTIONS_FROM_BIN -R .NVM) +endif() \ No newline at end of file diff --git a/examples/thermostat/nxp/rt/rw61x/CMakeLists.txt b/examples/thermostat/nxp/rt/rw61x/CMakeLists.txt new file mode 100644 index 00000000000000..25c05e96ba570a --- /dev/null +++ b/examples/thermostat/nxp/rt/rw61x/CMakeLists.txt @@ -0,0 +1,38 @@ +# +# Copyright (c) 2024 Project CHIP Authors +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +cmake_minimum_required(VERSION 3.13.1) + +project(chip-rw61x-thermostat-example) + +if (NOT CHIP_ROOT) + get_filename_component(CHIP_ROOT ${CMAKE_CURRENT_LIST_DIR}/../../../../.. REALPATH) +endif() + +# Define the GN root target for the application +get_filename_component(GN_ROOT_TARGET ${CMAKE_CURRENT_LIST_DIR} REALPATH) + +# Include platform specific configs / variables +include(${CHIP_ROOT}/examples/platform/nxp/rt/rw61x/platform_config.cmake) + +add_subdirectory(${CHIP_ROOT}/config/nxp/chip-cmake-freertos ./chip) + +#************************************************************************************** +# Build example application +#************************************************************************************** +if(CONFIG_CHIP_BUILD_APP_WITH_GN) + nxp_build_app_with_gn() +endif() \ No newline at end of file diff --git a/scripts/build/build/targets.py b/scripts/build/build/targets.py index a6e386ff4949c4..f875e0dafb11ce 100755 --- a/scripts/build/build/targets.py +++ b/scripts/build/build/targets.py @@ -28,7 +28,7 @@ from builders.mw320 import MW320App, MW320Builder from builders.nrf import NrfApp, NrfBoard, NrfConnectBuilder from builders.nuttx import NuttXApp, NuttXBoard, NuttXBuilder -from builders.nxp import NxpApp, NxpBoard, NxpBuilder, NxpOsUsed +from builders.nxp import NxpApp, NxpBoard, NxpBoardVariant, NxpBuilder, NxpBuildSystem, NxpOsUsed from builders.openiotsdk import OpenIotSdkApp, OpenIotSdkBuilder, OpenIotSdkCryptoBackend from builders.qpg import QpgApp, QpgBoard, QpgBuilder from builders.stm32 import stm32App, stm32Board, stm32Builder @@ -550,6 +550,9 @@ def BuildNxpTarget(): target.AppendModifier(name="matter-shell", enable_shell=True).ExceptIfRe('k32w0|k32w1') target.AppendModifier('data-model-disabled', data_model_interface="disabled").ExceptIfRe('-data-model-enabled') target.AppendModifier('data-model-enabled', data_model_interface="enabled").ExceptIfRe('-data-model-disabled') + target.AppendModifier(name="factory-build", enable_factory_data_build=True).OnlyIfRe('rw61x') + target.AppendModifier(name="frdm", board_variant=NxpBoardVariant.FRDM).OnlyIfRe('rw61x') + target.AppendModifier(name="cmake", build_system=NxpBuildSystem.CMAKE).OnlyIfRe('rw61x') return target diff --git a/scripts/build/builders/nxp.py b/scripts/build/builders/nxp.py index 7ab73633a4aed8..c78ea1ca58fee6 100644 --- a/scripts/build/builders/nxp.py +++ b/scripts/build/builders/nxp.py @@ -35,6 +35,19 @@ def OsEnv(self): raise Exception('Unknown OS type: %r' % self) +class NxpBuildSystem(Enum): + GN = auto() + CMAKE = auto() + + def BuildSystem(self): + if self == NxpBuildSystem.GN: + return 'gn' + elif self == NxpBuildSystem.CMAKE: + return 'cmake' + else: + raise Exception('Unknown build system: %r' % self) + + class NxpBoard(Enum): K32W0 = auto() K32W1 = auto() @@ -76,6 +89,20 @@ def FolderName(self, os_env): raise Exception('Unknown board type: %r' % self) +class NxpBoardVariant(Enum): + RD = auto() + FRDM = auto() + + def BoardVariantName(self, board): + if board != NxpBoard.RW61X: + raise Exception('Board variants only supported for RW61X') + + if self == NxpBoardVariant.RD: + return "rdrw612bga" + elif self == NxpBoardVariant.FRDM: + return "frdm" + + class NxpApp(Enum): LIGHTING = auto() CONTACT = auto() @@ -127,7 +154,9 @@ def __init__(self, runner, app: NxpApp = NxpApp.LIGHTING, board: NxpBoard = NxpBoard.K32W0, + board_variant: NxpBoardVariant = None, os_env: NxpOsUsed = NxpOsUsed.FREERTOS, + build_system: NxpBuildSystem = NxpBuildSystem.GN, low_power: bool = False, smu2: bool = False, enable_factory_data: bool = False, @@ -140,11 +169,11 @@ def __init__(self, enable_thread: bool = False, enable_wifi: bool = False, enable_ethernet: bool = False, - disable_ipv4: bool = False, enable_shell: bool = False, enable_ota: bool = False, data_model_interface: Optional[str] = None, - ): + enable_factory_data_build: bool = False, + disable_pairing_autostart: bool = False): super(NxpBuilder, self).__init__( root=app.BuildRoot(root, board, os_env), runner=runner) @@ -152,6 +181,7 @@ def __init__(self, self.app = app self.board = board self.os_env = os_env + self.build_system = build_system self.low_power = low_power self.smu2 = smu2 self.enable_factory_data = enable_factory_data @@ -160,7 +190,6 @@ def __init__(self, self.enable_lit = enable_lit self.enable_rotating_id = enable_rotating_id self.has_sw_version_2 = has_sw_version_2 - self.disable_ipv4 = disable_ipv4 self.disable_ble = disable_ble self.enable_thread = enable_thread self.enable_wifi = enable_wifi @@ -168,6 +197,9 @@ def __init__(self, self.enable_ota = enable_ota self.enable_shell = enable_shell self.data_model_interface = data_model_interface + self.enable_factory_data_build = enable_factory_data_build + self.disable_pairing_autostart = disable_pairing_autostart + self.board_variant = board_variant def GnBuildArgs(self): args = [] @@ -222,26 +254,62 @@ def GnBuildArgs(self): return args - def WestBuildArgs(self): - args = [] + def CmakeBuildFlags(self): + flags = [] + if self.enable_factory_data: - args.append('-DFILE_SUFFIX=fdata') + if self.os_env == NxpOsUsed.ZEPHYR: + flags.append('-DFILE_SUFFIX=fdata') + else: + flags.append("-DCONFIG_CHIP_FACTORY_DATA=true") if self.enable_ethernet: - args.append('-DEXTRA_CONF_FILE="prj_ethernet.conf"') + if self.os_env == NxpOsUsed.ZEPHYR: + flags.append('-DEXTRA_CONF_FILE="prj_ethernet.conf"') if self.has_sw_version_2: - args.append('-DCONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2') + flags.append("-DCONFIG_CHIP_DEVICE_SOFTWARE_VERSION=2") + flags.append("-DCONFIG_CHIP_DEVICE_SOFTWARE_VERSION_STRING=\"2.0\"") if self.data_model_interface: # NOTE: this is not supporting "check" enabled = "y" if self.data_model_interface.lower() == "enabled" else "n" - args.append(f"-DCONFIG_USE_CHIP_DATA_MODEL_INTERFACE={enabled}") + flags.append(f"-DCONFIG_USE_CHIP_DATA_MODEL_INTERFACE={enabled}") + + if self.enable_ota: + flags.append("-DCONFIG_CHIP_OTA_REQUESTOR=true") + if self.os_env == NxpOsUsed.FREERTOS and self.board == NxpBoard.RW61X: + flags.append("-DCONFIG_BOOTLOADER_MCUBOOT=true") + + if self.disable_ble: + flags.append("-DCONFIG_BT=false") + + if self.enable_wifi: + flags.append('-DCONFIG_CHIP_WIFI=true') - build_args = " -- " + " ".join(args) if len(args) > 0 else "" - return build_args + if self.enable_thread: + flags.append("-DCONFIG_NET_L2_OPENTHREAD=true -DCONFIG_CHIP_IPV4=false") + + if self.enable_factory_data_build: + # Generate the factory data binary + flags.append("-DCONFIG_CHIP_FACTORY_DATA_BUILD=true -DCONFIG_CHIP_FACTORY_DATA=true") + + if self.enable_shell: + flags.append("-DCONFIG_CHIP_LIB_SHELL=true") + + if self.disable_pairing_autostart: + flags.append('-DCONFIG_CHIP_ENABLE_PAIRING_AUTOSTART=false') + + if self.board_variant: + flag_board_variant = "-DCONFIG_BOARD_VARIANT=\"%s\"" % self.board_variant.BoardVariantName(self.board) + flags.append(flag_board_variant) + + build_flags = " ".join(flags) + + return build_flags def generate(self): + build_flags = self.CmakeBuildFlags() if self.os_env == NxpOsUsed.ZEPHYR: if 'ZEPHYR_NXP_SDK_INSTALL_DIR' not in os.environ: raise Exception("ZEPHYR_NXP_SDK_INSTALL_DIR need to be set") @@ -253,11 +321,11 @@ def generate(self): cmd += '\nexport ZEPHYR_BASE="$ZEPHYR_NXP_BASE"' cmd += '\nunset ZEPHYR_TOOLCHAIN_VARIANT' - cmd += '\nwest build -p --cmake-only -b {board_name} -d {out_folder} {example_folder}{build_args}'.format( + cmd += '\nwest build -p --cmake-only -b {board_name} -d {out_folder} {example_folder} {build_flags}'.format( board_name=self.board.Name(self.os_env), out_folder=self.output_dir, example_folder=self.app.BuildRoot(self.code_root, self.board, self.os_env), - build_args=self.WestBuildArgs()) + build_flags=build_flags) self._Execute(['bash', '-c', cmd], title='Generating ' + self.identifier) else: cmd = '' @@ -273,29 +341,40 @@ def generate(self): cmd += 'export NXP_K32W0_SDK_ROOT="' + str(p.sdk_storage_location_abspath) + '" \n ' elif p.sdk_name == 'common': cmd += 'export NXP_SDK_ROOT="' + str(p.sdk_storage_location_abspath) + '" \n ' - # add empty space at the end to avoid concatenation issue when there is no --args - cmd += 'gn gen --check --fail-on-unused-args --export-compile-commands --root=%s ' % self.root - extra_args = [] + if self.build_system == NxpBuildSystem.CMAKE: + cmd += ''' + cmake -GNinja {build_flags} -H{example_folder} -B{out_folder} + '''.format( + build_flags=build_flags, + example_folder=self.app.BuildRoot(self.code_root, self.board, self.os_env), + out_folder=self.output_dir).strip() + self._Execute(['bash', '-c', cmd], title='Generating ' + self.identifier) - if self.options.pw_command_launcher: - extra_args.append('pw_command_launcher="%s"' % self.options.pw_command_launcher) + elif self.build_system == NxpBuildSystem.GN: + # add empty space at the end to avoid concatenation issue when there is no --args + cmd += 'gn gen --check --fail-on-unused-args --export-compile-commands --root=%s ' % self.root - if self.options.enable_link_map_file: - extra_args.append('chip_generate_link_map_file=true') + extra_args = [] + + if self.options.pw_command_launcher: + extra_args.append('pw_command_launcher="%s"' % self.options.pw_command_launcher) - if self.options.pregen_dir: - extra_args.append('chip_code_pre_generated_directory="%s"' % self.options.pregen_dir) + if self.options.enable_link_map_file: + extra_args.append('chip_generate_link_map_file=true') - extra_args.extend(self.GnBuildArgs() or []) - if extra_args: - cmd += " --args='%s" % ' '.join(extra_args) + "' " + if self.options.pregen_dir: + extra_args.append('chip_code_pre_generated_directory="%s"' % self.options.pregen_dir) - cmd += self.output_dir + extra_args.extend(self.GnBuildArgs() or []) + if extra_args: + cmd += ' --args="%s' % ' '.join(extra_args) + '" ' - title = 'Generating ' + self.identifier + cmd += self.output_dir - self._Execute(['bash', '-c', cmd], title=title) + title = 'Generating ' + self.identifier + + self._Execute(['bash', '-c', cmd], title=title) def build_outputs(self): name = 'chip-%s-%s' % (self.board.Name(self.os_env), self.app.NameSuffix()) @@ -308,10 +387,19 @@ def build_outputs(self): os.path.join(self.output_dir, 'zephyr', 'zephyr.map'), f'{name}.map') else: - yield BuilderOutput( - os.path.join(self.output_dir, name), - f'{name}.elf') - if self.options.enable_link_map_file: + if self.build_system == NxpBuildSystem.GN: yield BuilderOutput( - os.path.join(self.output_dir, f'{name}.map'), - f'{name}.map') + os.path.join(self.output_dir, name), + f'{name}.elf') + if self.options.enable_link_map_file: + yield BuilderOutput( + os.path.join(self.output_dir, f'{name}.map'), + f'{name}.map') + elif self.build_system == NxpBuildSystem.CMAKE: + yield BuilderOutput( + os.path.join(self.output_dir, 'out/debug', name), + f'{name}.elf') + if self.options.enable_link_map_file: + yield BuilderOutput( + os.path.join(self.output_dir, 'out/debug', f'{name}.map'), + f'{name}.map') diff --git a/scripts/build/testdata/all_targets_linux_x64.txt b/scripts/build/testdata/all_targets_linux_x64.txt index a5a28f3fc28986..65d167f34f9215 100644 --- a/scripts/build/testdata/all_targets_linux_x64.txt +++ b/scripts/build/testdata/all_targets_linux_x64.txt @@ -13,7 +13,7 @@ linux-{x64,arm64}-{rpc-console,all-clusters,all-clusters-minimal,chip-tool,therm linux-x64-efr32-test-runner[-clang] imx-{chip-tool,lighting-app,thermostat,all-clusters-app,all-clusters-minimal-app,ota-provider-app}[-release] infineon-psoc6-{lock,light,all-clusters,all-clusters-minimal}[-ota][-updateimage][-trustm] -nxp-{k32w0,k32w1,rw61x,rw61x_eth,mcxw71}-{zephyr,freertos}-{lighting,contact-sensor,lock-app,all-clusters,laundry-washer,thermostat}[-factory][-low-power][-lit][-fro32k][-smu2][-dac-conversion][-rotating-id][-sw-v2][-ota][-wifi][-ethernet][-thread][-matter-shell][-data-model-disabled][-data-model-enabled] +nxp-{k32w0,k32w1,rw61x,rw61x_eth,mcxw71}-{zephyr,freertos}-{lighting,contact-sensor,lock-app,all-clusters,laundry-washer,thermostat}[-factory][-low-power][-lit][-fro32k][-smu2][-dac-conversion][-rotating-id][-sw-v2][-ota][-wifi][-ethernet][-thread][-matter-shell][-data-model-disabled][-data-model-enabled][-factory-build][-frdm][-cmake] mbed-cy8cproto_062_4343w-{lock,light,all-clusters,all-clusters-minimal,pigweed,ota-requestor,shell}[-release][-develop][-debug][-data-model-disabled][-data-model-enabled] mw320-all-clusters-app nrf-{nrf5340dk,nrf52840dk,nrf52840dongle}-{all-clusters,all-clusters-minimal,lock,light,light-switch,shell,pump,pump-controller,window-covering}[-rpc][-data-model-disabled][-data-model-enabled] diff --git a/scripts/setup/requirements.nxp.txt b/scripts/setup/requirements.nxp.txt index 615e170ce83ce4..471b3b4bea22b7 100644 --- a/scripts/setup/requirements.nxp.txt +++ b/scripts/setup/requirements.nxp.txt @@ -1,3 +1,6 @@ -crc>=7.0.0 -jsonschema>=4.17.0 -pycryptodome>=3.20.0 +crc>=7.0.0 +jsonschema>=4.17.0 +pycryptodome>=3.20.0 +intelhex +cbor +cbor2 \ No newline at end of file diff --git a/third_party/nxp/nxp_matter_support b/third_party/nxp/nxp_matter_support index 21d18627ad4671..b2855d3e28556d 160000 --- a/third_party/nxp/nxp_matter_support +++ b/third_party/nxp/nxp_matter_support @@ -1 +1 @@ -Subproject commit 21d18627ad46710dfb863080c1047cdbaf556d25 +Subproject commit b2855d3e28556d145889fdba889fba286c60a93f From 3fd4f80abc74e2900cdf50f475bfa35b7cf02a55 Mon Sep 17 00:00:00 2001 From: Harshith-GRL <145322529+Harshith-GRL@users.noreply.github.com> Date: Thu, 19 Sep 2024 21:32:10 +0530 Subject: [PATCH 31/47] Python Script DRLK 2.13 is updated as per latest test-plan (#35652) * Python Script DRLK 2.13 is updated as per latest test-plan * scripts changes are made as per comments in PR --- src/python_testing/TC_DRLK_2_13.py | 52 ++++++++++++++++-------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/src/python_testing/TC_DRLK_2_13.py b/src/python_testing/TC_DRLK_2_13.py index 78f6ef0a0cae68..a26297d5c15632 100644 --- a/src/python_testing/TC_DRLK_2_13.py +++ b/src/python_testing/TC_DRLK_2_13.py @@ -53,6 +53,7 @@ class TC_DRLK_2_13(MatterBaseTest): def steps_TC_DRLK_2_13(self) -> list[TestStep]: steps = [ + TestStep("0", "Commissoning with DUT is done", is_commissioning=True), TestStep("1a", "TH reads OperationalCredentials cluster's CurrentFabricIndex and save the attribute", "TH Reads Attribute Successfully"), TestStep("1b", "TH sends ClearUser Command to DUT with the UserIndex as 0xFFFE to clear all the users", @@ -145,11 +146,11 @@ def steps_TC_DRLK_2_13(self) -> list[TestStep]: "Verify that the DUT responds with SetCredentialResponse command and Status success. This step will fill the last slot with credentialType as AliroEvictableEndpointKey"), TestStep("31", "TH sends SetCredential Command to DUT with CredentialType as AliroNonEvictableEndpointKey and number of credentials for 'alirouser' exceeds the max_aliro_keys_supported", - "Verify that the DUT responds with SetCredentialResponse command and Status success."), - TestStep("32", "TH sends GetCredentialStatus Command with Credential as 7 startcredentialindex+1", - "DUT responds with GetCredentialStatusResponse Command and CredentialExists is false"), - TestStep("33", "TH sends GetCredentialStatus Command with Credential as 8 startcredentialindex+1", - "Verify DUT responds with GetCredentialStatusResponse having CredentialExists is true and UserIndex as 1"), + "Verify that the DUT responds with SetCredentialResponse command and Status ResourceExhausted"), + TestStep("32", "TH sends GetCredentialStatus Command with Credential as 7 1", + "DUT responds with GetCredentialStatusResponse Command and CredentialExists is True"), + TestStep("33", "TH sends GetCredentialStatus Command with Credential as 8 max_aliro_keys_supported", + "Verify DUT responds with GetCredentialStatusResponse having CredentialExists is false and UserIndex as 1"), TestStep("34", "TH sends ClearCredential Command to DUT to clear the ALIRO CredentialType", "Verify that the DUT sends SUCCESS response"), TestStep("35", "TH sends ClearUser Command to DUT with the UserIndex as 1", @@ -249,7 +250,7 @@ async def get_credentials_status(self, credentialIndex: int, credentialType: clu self.step(step) try: flags = ["DRLK.S.F0d", "DRLK.S.C24.Rsp", "DRLK.S.C25.Tx"] - if not self.pics_guard(all([self.check_pics(p) for p in flags])): + if self.pics_guard(all([self.check_pics(p) for p in flags])): credentials_struct = cluster.Structs.CredentialStruct(credentialIndex=credentialIndex, credentialType=credentialType) response = await self.send_single_cmd(endpoint=self.app_cluster_endpoint, timedRequestTimeoutMs=1000, @@ -268,7 +269,8 @@ async def get_credentials_status(self, credentialIndex: int, credentialType: clu asserts.assert_equal(e.status, Status.Success, f"Unexpected error returned: {e}") async def set_credential_cmd(self, credential_enum: Clusters.DoorLock.Enums.CredentialTypeEnum, credentialIndex, - operationType, userIndex, credentialData, userStatus, userType, step=None): + operationType, userIndex, credentialData, userStatus, userType, step=None, + expected_status: Status = Status.Success): if step: self.step(step) credentials = cluster.Structs.CredentialStruct( @@ -287,7 +289,7 @@ async def set_credential_cmd(self, credential_enum: Clusters.DoorLock.Enums.Cred timedRequestTimeoutMs=1000) asserts.assert_true(type_matches(response, Clusters.Objects.DoorLock.Commands.SetCredentialResponse), "Unexpected return type for SetCredential") - asserts.assert_true(response.status == Status.Success, + asserts.assert_true(response.status == expected_status, "Error sending SetCredential command, status={}".format(str(response.status))) except InteractionModelError as e: logging.exception(e) @@ -370,6 +372,7 @@ async def test_TC_DRLK_2_13(self): self.alirononevictableendpointkey1 = bytes.fromhex( "047a4c552d753924cdf3779a3c84fec2debaa6f0b3084450878acc7ddcce7856ae57b1ebbe2561015103dd7474c2a183675378ec55f1e465ac3436bf3dd5ca54d4") # step 1 TH reads DUT Endpoint 0 OperationalCredentials cluster CurrentFabricIndex attribute + self.step("0") self.step("1a") self.fabric_idx1 = await self.read_attributes_from_dut(endpoint=self.common_cluster_endpoint, cluster=Clusters.Objects.OperationalCredentials, @@ -569,6 +572,8 @@ async def test_TC_DRLK_2_13(self): endpoint=self.app_cluster_endpoint, cluster=Clusters.Objects.DoorLock, attribute=Clusters.DoorLock.Attributes.NumberOfCredentialsSupportedPerUser) + logging.info(f"After reading attribute NumberOfCredentialsSupportedPerUser we get" + f" value {self.numberofcredentialsupportedperuser} ") self.step("28b") await self.clear_all_aliro_credential() await self.send_clear_user_cmd(user_index=1) @@ -600,7 +605,7 @@ async def test_TC_DRLK_2_13(self): start_credential_index = 1 credentials_data = self.alirononevictableendpointkey while 1: - if start_credential_index <= (self.max_aliro_keys_supported - 2): + if start_credential_index <= (self.max_aliro_keys_supported - 1): if start_credential_index != 1: credentials_data = self.generate_unique_octbytes() @@ -614,37 +619,36 @@ async def test_TC_DRLK_2_13(self): logging.info(f"The updated value of start_credential_index is {start_credential_index}") else: break - - # step 30 - logging.info(f"the value of start_credential_index is {start_credential_index} for step 30") self.step("30") await self.set_credential_cmd(credentialData=self.alirononevictableendpointkey, operationType=cluster.Enums.DataOperationTypeEnum.kAdd, credential_enum=cluster.Enums.CredentialTypeEnum.kAliroEvictableEndpointKey, - credentialIndex=start_credential_index, userIndex=1, userStatus=NullValue, + credentialIndex=1, userIndex=1, userStatus=NullValue, userType=NullValue) + # step 31 self.step("31") await self.set_credential_cmd(credentialData=self.alirononevictableendpointkey1, operationType=cluster.Enums.DataOperationTypeEnum.kAdd, credential_enum=cluster.Enums.CredentialTypeEnum.kAliroNonEvictableEndpointKey, - credentialIndex=start_credential_index, userIndex=1, userStatus=NullValue, - userType=NullValue) + credentialIndex=self.max_aliro_keys_supported, userIndex=1, userStatus=NullValue, + userType=NullValue, + expected_status=Status.ResourceExhausted) # step 32 - dut_get_cred_response = await self.get_credentials_status(step="32", - credentialIndex=start_credential_index, - credentialType=cluster.Enums.CredentialTypeEnum.kAliroEvictableEndpointKey, - credential_exists=False, userIndex=NullValue) - asserts.assert_equal(dut_get_cred_response.credentialExists, NullValue, - f"Error when comparing for {dut_get_cred_response} of null") + await self.get_credentials_status(step="32", credentialIndex=1, + credentialType=cluster.Enums.CredentialTypeEnum.kAliroEvictableEndpointKey, + credential_exists=True, userIndex=1) # step 33 - await self.get_credentials_status(step="33", credentialIndex=start_credential_index, + await self.get_credentials_status(step="33", credentialIndex=self.max_aliro_keys_supported, credentialType=cluster.Enums.CredentialTypeEnum.kAliroNonEvictableEndpointKey, - credential_exists=True, userIndex=1) + credential_exists=False, userIndex=NullValue) # step 34 self.step("34") - await self.clear_all_aliro_credential() + if self.pics_guard(self.check_pics("DRLK.S.C26.Rsp")): + await self.send_single_cmd(cmd=Clusters.DoorLock.Commands.ClearCredential(credential=NullValue), + endpoint=self.app_cluster_endpoint, + timedRequestTimeoutMs=1000) # step 35 self.step("35") From 00d755c18965263cf66374f4e9da2f0ae752ba25 Mon Sep 17 00:00:00 2001 From: C Freeman Date: Thu, 19 Sep 2024 12:02:22 -0400 Subject: [PATCH 32/47] Spec parsing: Add global commands for thermostat (#35607) * Spec parsing: Add global commands for thermostat * use in-progress for clusters too * Fix command check (merge conflict?) * Restyled by isort * Fix test that checks the default cluster dir --------- Co-authored-by: Restyled.io --- src/python_testing/TC_DeviceConformance.py | 5 +--- src/python_testing/TestSpecParsingSupport.py | 29 +++++++++++++++++++- src/python_testing/spec_parsing_support.py | 22 ++++++++++++++- 3 files changed, 50 insertions(+), 6 deletions(-) diff --git a/src/python_testing/TC_DeviceConformance.py b/src/python_testing/TC_DeviceConformance.py index a6d6f19bfb53e7..86a981c86cde15 100644 --- a/src/python_testing/TC_DeviceConformance.py +++ b/src/python_testing/TC_DeviceConformance.py @@ -166,7 +166,6 @@ def record_warning(location, problem): if attribute_id not in self.xml_clusters[cluster_id].attributes.keys(): # TODO: Consolidate the range checks with IDM-10.1 once that lands if attribute_id <= 0x4FFF: - # manufacturer attribute record_error(location=location, problem='Standard attribute found on device, but not in spec') continue xml_attribute = self.xml_clusters[cluster_id].attributes[attribute_id] @@ -193,9 +192,7 @@ def check_spec_conformance_for_commands(command_type: CommandType): if command_id not in xml_commands_dict: # TODO: Consolidate range checks with IDM-10.1 once that lands if command_id <= 0xFF: - # manufacturer command - continue - record_error(location=location, problem='Standard command found on device, but not in spec') + record_error(location=location, problem='Standard command found on device, but not in spec') continue xml_command = xml_commands_dict[command_id] conformance_decision_with_choice = xml_command.conformance(feature_map, attribute_list, all_command_list) diff --git a/src/python_testing/TestSpecParsingSupport.py b/src/python_testing/TestSpecParsingSupport.py index aa2a68427607e4..c7f087cb03d834 100644 --- a/src/python_testing/TestSpecParsingSupport.py +++ b/src/python_testing/TestSpecParsingSupport.py @@ -272,7 +272,8 @@ def test_build_xml_override(self): asserts.assert_equal(set(in_progress.keys())-set(tot_xml_clusters.keys()), set(), "There are some in_progress clusters that are not included in the TOT spec") - str_path = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '..', '..', 'data_model', 'master', 'clusters')) + str_path = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), + '..', '..', 'data_model', 'in_progress', 'clusters')) string_override_check, problems = build_xml_clusters(str_path) asserts.assert_equal(string_override_check.keys(), self.spec_xml_clusters.keys(), "Mismatched cluster generation") @@ -462,6 +463,32 @@ def test_provisional_clusters(self): asserts.assert_in(id, clusters.keys(), "Non-provisional cluster not parsed") asserts.assert_false(clusters[id].is_provisional, "Non-provisional cluster marked as provisional") + def test_atomic_thermostat(self): + tot_xml_clusters, problems = build_xml_clusters(PrebuiltDataModelDirectory.kMaster) + one_three_clusters, problems = build_xml_clusters(PrebuiltDataModelDirectory.k1_3) + in_progress, problems = build_xml_clusters(PrebuiltDataModelDirectory.kInProgress) + + asserts.assert_in("Atomic Request", tot_xml_clusters[Clusters.Thermostat.id].command_map, + "Atomic request not found on thermostat command map") + request_id = tot_xml_clusters[Clusters.Thermostat.id].command_map["Atomic Request"] + asserts.assert_in(request_id, tot_xml_clusters[Clusters.Thermostat.id].accepted_commands.keys(), + "Atomic request not found in thermostat accepted command list") + + asserts.assert_in("Atomic Response", tot_xml_clusters[Clusters.Thermostat.id].command_map, + "Atomic response not found in the thermostat command map") + response_id = tot_xml_clusters[Clusters.Thermostat.id].command_map["Atomic Response"] + asserts.assert_in(response_id, tot_xml_clusters[Clusters.Thermostat.id].generated_commands.keys(), + "Atomic response not found in thermostat generated command list") + + asserts.assert_not_in( + "Atomic Request", one_three_clusters[Clusters.Thermostat.id].command_map, "Atomic request found on thermostat command map for 1.3") + asserts.assert_not_in(request_id, one_three_clusters[Clusters.Thermostat.id].accepted_commands.keys(), + "Atomic request found in thermostat accepted command list for 1.3") + asserts.assert_not_in( + "Atomic Response", one_three_clusters[Clusters.Thermostat.id].command_map, "Atomic response found on thermostat command map for 1.3") + asserts.assert_not_in(response_id, one_three_clusters[Clusters.Thermostat.id].generated_commands.keys(), + "Atomic request found in thermostat generated command list for 1.3") + if __name__ == "__main__": default_matter_test_main() diff --git a/src/python_testing/spec_parsing_support.py b/src/python_testing/spec_parsing_support.py index 445e168ecb4f5a..5a66a900c28c91 100644 --- a/src/python_testing/spec_parsing_support.py +++ b/src/python_testing/spec_parsing_support.py @@ -26,6 +26,7 @@ from typing import Callable, Optional import chip.clusters as Clusters +import conformance_support from chip.tlv import uint from conformance_support import (OPTIONAL_CONFORM, TOP_LEVEL_CONFORMANCE_TAGS, ConformanceDecision, ConformanceException, ConformanceParseParameters, feature, is_disallowed, mandatory, optional, or_operation, @@ -528,7 +529,7 @@ def _get_data_model_directory(data_model_directory: typing.Union[PrebuiltDataMod return data_model_directory -def build_xml_clusters(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str] = PrebuiltDataModelDirectory.kMaster) -> tuple[dict[uint, XmlCluster], list[ProblemNotice]]: +def build_xml_clusters(data_model_directory: typing.Union[PrebuiltDataModelDirectory, str] = PrebuiltDataModelDirectory.kInProgress) -> tuple[dict[uint, XmlCluster], list[ProblemNotice]]: dir = _get_data_model_directory(data_model_directory, DataModelLevel.kCluster) clusters: dict[int, XmlCluster] = {} @@ -611,6 +612,25 @@ def remove_problem(location: typing.Union[CommandPathLocation, FeaturePathLocati 0x05: XmlAttribute(name='SupportedTemperatureLevels', datatype='list', conformance=feature(0x02, 'TL'), read_access=view, write_access=none, write_optional=False), } + # TODO: Need automated parsing for atomic attributes. + atomic_request_cmd_id = 0xFE + atomic_response_cmd_id = 0xFD + atomic_request_name = "Atomic Request" + atomic_response_name = "Atomic Response" + presets_name = "Presets" + schedules_name = "Schedules" + if clusters[Clusters.Thermostat.id].revision >= 8: + presents_id = clusters[Clusters.Thermostat.id].attribute_map[presets_name] + schedules_id = clusters[Clusters.Thermostat.id].attribute_map[schedules_name] + conformance = or_operation([conformance_support.attribute(presents_id, presets_name), + conformance_support.attribute(schedules_id, schedules_name)]) + clusters[Clusters.Thermostat.id].accepted_commands[atomic_request_cmd_id] = XmlCommand( + id=atomic_request_cmd_id, name=atomic_request_name, conformance=conformance) + clusters[Clusters.Thermostat.id].generated_commands[atomic_response_cmd_id] = XmlCommand( + id=atomic_response_cmd_id, name=atomic_response_name, conformance=conformance) + clusters[Clusters.Thermostat.id].command_map[atomic_request_name] = atomic_request_cmd_id + clusters[Clusters.Thermostat.id].command_map[atomic_response_name] = atomic_response_cmd_id + check_clusters_for_unknown_commands(clusters, problems) return clusters, problems From 12f04dc86e1e8a571becfbc0b621b31333a2db1a Mon Sep 17 00:00:00 2001 From: Vatsal Ghelani <152916324+vatsalghelani-csa@users.noreply.github.com> Date: Thu, 19 Sep 2024 12:03:19 -0400 Subject: [PATCH 33/47] Updates comments for the excluded python test scripts based on their current status in the CI pipeline (#35660) * Script updated with comments on why the scripts have been included from the glob run * Restyled by autopep8 * Removed exclusion test script explanation * Fixed comments on the test scripts * Fix excluded scripts for adding support scripts still in the directory --------- Co-authored-by: Restyled.io --- src/python_testing/execute_python_tests.py | 104 ++++++++++----------- 1 file changed, 47 insertions(+), 57 deletions(-) diff --git a/src/python_testing/execute_python_tests.py b/src/python_testing/execute_python_tests.py index de8908ca13be25..1f8621ca2a9b05 100644 --- a/src/python_testing/execute_python_tests.py +++ b/src/python_testing/execute_python_tests.py @@ -55,66 +55,56 @@ def main(search_directory, env_file): # Define the files and patterns to exclude excluded_patterns = { - "MinimalRepresentation.py", - "TC_CNET_4_4.py", - "TC_CCTRL_2_1.py", - "TC_CCTRL_2_2.py", - "TC_CCTRL_2_3.py", - "TC_DGGEN_3_2.py", - "TC_EEVSE_Utils.py", - "TC_ECOINFO_2_1.py", - "TC_ECOINFO_2_2.py", - "TC_EWATERHTRBase.py", - "TC_EWATERHTR_2_1.py", - "TC_EWATERHTR_2_2.py", - "TC_EWATERHTR_2_3.py", - "TC_EnergyReporting_Utils.py", - "TC_OpstateCommon.py", - "TC_pics_checker.py", - "TC_TMP_2_1.py", - "TC_MCORE_FS_1_1.py", - "TC_MCORE_FS_1_2.py", - "TC_MCORE_FS_1_3.py", - "TC_MCORE_FS_1_4.py", - "TC_MCORE_FS_1_5.py", - "TC_OCC_3_1.py", - "TC_OCC_3_2.py", - "TC_BRBINFO_4_1.py", - "TestCommissioningTimeSync.py", - "TestConformanceSupport.py", - "TestChoiceConformanceSupport.py", - "TC_DEMTestBase.py", - "choice_conformance_support.py", - "TestConformanceTest.py", # Unit test of the conformance test (TC_DeviceConformance) - does not run against an app. - "TestIdChecks.py", - "TestSpecParsingDeviceType.py", - "TestConformanceTest.py", - "TestMatterTestingSupport.py", - "TestSpecParsingSupport.py", - "TestTimeSyncTrustedTimeSource.py", - "basic_composition_support.py", - "conformance_support.py", - "drlk_2_x_common.py", + "MinimalRepresentation.py", # Code/Test not being used or not shared code for any other tests + "TC_CNET_4_4.py", # It has no CI execution block, is not executed in CI + "TC_CCTRL_2_1.py", # They rely on example applications that inter-communicate and there is no example app that works right now + "TC_CCTRL_2_2.py", # They rely on example applications that inter-communicate and there is no example app that works right now + "TC_CCTRL_2_3.py", # They rely on example applications that inter-communicate and there is no example app that works right now + "TC_DGGEN_3_2.py", # src/python_testing/test_testing/test_TC_DGGEN_3_2.py is the Unit test of this test + "TC_EEVSE_Utils.py", # Shared code for TC_EEVSE, not a standalone test + "TC_ECOINFO_2_1.py", # They rely on example applications that inter-communicate and there is no example app that works right now + "TC_ECOINFO_2_2.py", # They rely on example applications that inter-communicate and there is no example app that works right now + "TC_EWATERHTRBase.py", # Shared code for TC_EWATERHTR, not a standalone test + "TC_EnergyReporting_Utils.py", # Shared code for TC_EEM and TC_EPM, not a standalone test + "TC_OpstateCommon.py", # Shared code for TC_OPSTATE, not a standalone test + "TC_pics_checker.py", # Currently isn't enabled because we don't have any examples with conformant PICS + "TC_TMP_2_1.py", # src/python_testing/test_testing/test_TC_TMP_2_1.py is the Unit test of this test + "TC_MCORE_FS_1_1.py", # This test requires a TH_SERVER application, hence not ready run with CI + "TC_MCORE_FS_1_2.py", # This test requires a TH_SERVER application, hence not ready run with CI + "TC_MCORE_FS_1_3.py", # This test requires a TH_SERVER application, hence not ready run with CI + "TC_MCORE_FS_1_4.py", # This test requires a TH_SERVER application, hence not ready run with CI + "TC_MCORE_FS_1_5.py", # This test requires a TH_SERVER application, hence not ready run with CI + "TC_OCC_3_1.py", # There are CI issues for the test cases that implements manually controlling sensor device for the occupancy state ON/OFF change + "TC_OCC_3_2.py", # There are CI issues for the test cases that implements manually controlling sensor device for the occupancy state ON/OFF change + "TC_BRBINFO_4_1.py", # This test requires a TH_ICD_SERVER application, hence not ready run with CI + "TestCommissioningTimeSync.py", # Code/Test not being used or not shared code for any other tests + "TestConformanceSupport.py", # Unit test - does not run against an app + "TestChoiceConformanceSupport.py", # Unit test - does not run against an app + "TC_DEMTestBase.py", # Shared code for TC_DEM, not a standalone test + "TestConformanceTest.py", # Unit test of the conformance test (TC_DeviceConformance) - does not run against an app + "TestIdChecks.py", # Unit test - does not run against an app + "TestSpecParsingDeviceType.py", # Unit test - does not run against an app + "TestConformanceTest.py", # Unit test - does not run against an app + "TestMatterTestingSupport.py", # Unit test - does not run against an app + "TestSpecParsingSupport.py", # Unit test - does not run against an app + "TestTimeSyncTrustedTimeSource.py", # Unit test and shared code for scripts/tests/TestTimeSyncTrustedTimeSourceRunner.py + "drlk_2_x_common.py", # Shared code for TC_DRLK, not a standalone test + # Python code that runs all the python tests from src/python_testing (This code itself run via tests.yaml) "execute_python_tests.py", - "global_attribute_ids.py", - "hello_external_runner.py", - "hello_test.py", - "matter_testing_support.py", - "pics_support.py", - "spec_parsing_support.py", - "taglist_and_topology_test_support.py", - "test_plan_support.py", - "test_plan_table_generator.py" + "hello_external_runner.py", # Code/Test not being used or not shared code for any other tests + "hello_test.py", # Is a template for tests + "test_plan_support.py", # Shared code for TC_*, not a standalone test + "test_plan_table_generator.py", # Code/Test not being used or not shared code for any other tests + "basic_composition_support.py", # Test support/shared code script, not a standalone test + "choice_conformance_support.py", # Test support/shared code script, not a standalone test + "conformance_support.py", # Test support/shared code script, not a standalone test + "global_attribute_ids.py", # Test support/shared code script, not a standalone test + "matter_testing_support.py", # Test support/shared code script, not a standalone test + "pics_support.py", # Test support/shared code script, not a standalone test + "spec_parsing_support.py", # Test support/shared code script, not a standalone test + "taglist_and_topology_test_support.py" # Test support/shared code script, not a standalone test } - """ - Explanation for excluded files: - The above list of files are excluded from the tests as they are either not app-specific tests - or are run through a different block of tests mentioned in tests.yaml. - This is to ensure that only relevant test scripts are executed, avoiding redundancy and ensuring - the correctness of the test suite. - """ - # Get all .py files in the directory all_python_files = glob.glob(os.path.join(search_directory, "*.py")) From 0c4268bb9918f7873bb621db72a608a85970ece0 Mon Sep 17 00:00:00 2001 From: Amine Alami <43780877+Alami-Amine@users.noreply.github.com> Date: Thu, 19 Sep 2024 20:02:39 +0200 Subject: [PATCH 34/47] [libfuzzer] Fuzzing different Transport Types for all-clusters-app (#35629) * Fuzzing different Transport Types for all-clusters-app * Adding an enum value for the number of transport types * 1. replacing magic number when fuzzing the number of transport types 2. using different parts of the fuzzed input data for TransportType and for Payload * Restyled by clang-format * avoiding out of bounds access --------- Co-authored-by: Restyled.io --- .../all-clusters-app/linux/fuzzing-main.cpp | 26 ++++++++++++++++--- src/transport/raw/PeerAddress.h | 1 + 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/examples/all-clusters-app/linux/fuzzing-main.cpp b/examples/all-clusters-app/linux/fuzzing-main.cpp index 793a70a6a9fa3e..2d8422d0d2eee6 100644 --- a/examples/all-clusters-app/linux/fuzzing-main.cpp +++ b/examples/all-clusters-app/linux/fuzzing-main.cpp @@ -73,9 +73,20 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t * aData, size_t aSize) // For now, just dump the data as a UDP payload into the session manager. // But maybe we should try to separately extract a PeerAddress and data from // the incoming data? - Transport::PeerAddress peerAddr; + + // To avoid out-of-bounds access when acessing aData[1] + if (aSize < 2) + { + return 0; + } + + // dumping payload with fuzzed transport types + constexpr uint8_t numberOfTypes = static_cast(Transport::Type::kLast) + 1; + Transport::Type fuzzedTransportType = static_cast(aData[0] % numberOfTypes); + Transport::PeerAddress peerAddr(fuzzedTransportType); + System::PacketBufferHandle buf = - System::PacketBufferHandle::NewWithData(aData, aSize, /* aAdditionalSize = */ 0, /* aReservedSize = */ 0); + System::PacketBufferHandle::NewWithData(&aData[1], aSize - 1, /* aAdditionalSize = */ 0, /* aReservedSize = */ 0); if (buf.IsNull()) { // Too big; we couldn't represent this as a packetbuffer to start with. @@ -84,8 +95,17 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t * aData, size_t aSize) // Ignoring the return value from OnMessageReceived, because we might be // passing it all sorts of garbage that will cause it to fail. - Server::GetInstance().GetSecureSessionManager().OnMessageReceived(peerAddr, std::move(buf)); + // for TCP we need to have MessageTransportContext + if (fuzzedTransportType == Transport::Type::kTcp) + { + Transport::MessageTransportContext msgContext; + Server::GetInstance().GetSecureSessionManager().OnMessageReceived(peerAddr, std::move(buf), &msgContext); + } + else + { + Server::GetInstance().GetSecureSessionManager().OnMessageReceived(peerAddr, std::move(buf)); + } // Now process pending events until our sentinel is reached. PlatformMgr().ScheduleWork([](intptr_t) { PlatformMgr().StopEventLoopTask(); }); PlatformMgr().RunEventLoop(); diff --git a/src/transport/raw/PeerAddress.h b/src/transport/raw/PeerAddress.h index 896648f76f537a..60d92b8f7b5d04 100644 --- a/src/transport/raw/PeerAddress.h +++ b/src/transport/raw/PeerAddress.h @@ -54,6 +54,7 @@ enum class Type : uint8_t kBle, kTcp, kWiFiPAF, + kLast = kWiFiPAF, // This is not an actual transport type, it just refers to the last transport type }; /** From 9491d8ff2db57e6cb84e117d56c4cc936736c09c Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 19 Sep 2024 16:11:59 -0400 Subject: [PATCH 35/47] Remove shutdown implementation from base MTRDeviceController. (#35676) shutdown is overriden by both MTRDeviceController_Concrete and MTRDeviceController_XPC, so the base class implementation is not reachable. And it's the only caller of finalShutdown, so that can also be removed. Also, addRunAssertion/removeRunAssertion, are only used on concrete controllers and can be removed from the base class and from MTRDeviceController_Internal. With those removed, matchesPendingShutdownControllerWithOperationalCertificate would always return false, so that can be changed accordingly, and then clearPendingShutdown becomes unreachable. At this point _keepRunningAssertionCounter and _shutdownPending are never read and can be removed. And _assertionLock is never acquired, so it can also be removed. --- .../Framework/CHIP/MTRDeviceController.mm | 85 ++----------------- .../CHIP/MTRDeviceControllerFactory.mm | 3 + .../CHIP/MTRDeviceController_Concrete.h | 15 ++++ .../CHIP/MTRDeviceController_Internal.h | 14 --- 4 files changed, 26 insertions(+), 91 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index e39a4d14e75612..4c3afe8412040b 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -26,6 +26,7 @@ #import "MTRCommissionableBrowserResult_Internal.h" #import "MTRCommissioningParameters.h" #import "MTRConversion.h" +#import "MTRDefines_Internal.h" #import "MTRDeviceControllerDelegateBridge.h" #import "MTRDeviceControllerFactory_Internal.h" #import "MTRDeviceControllerLocalTestStorage.h" @@ -160,11 +161,6 @@ @implementation MTRDeviceController { // specific queue, so can't race against each other. std::atomic _suspended; - // Counters to track assertion status and access controlled by the _assertionLock - NSUInteger _keepRunningAssertionCounter; - BOOL _shutdownPending; - os_unfair_lock _assertionLock; - NSMutableArray * _delegates; id _strongDelegateForSetDelegateAPI; } @@ -183,11 +179,6 @@ - (instancetype)initForSubclasses:(BOOL)startSuspended } _underlyingDeviceMapLock = OS_UNFAIR_LOCK_INIT; - // Setup assertion variables - _keepRunningAssertionCounter = 0; - _shutdownPending = NO; - _assertionLock = OS_UNFAIR_LOCK_INIT; - _suspended = startSuspended; _nodeIDToDeviceMap = [NSMapTable strongToWeakObjectsMapTable]; @@ -231,11 +222,6 @@ - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory // before we start doing anything else with the controller. _uniqueIdentifier = uniqueIdentifier; - // Setup assertion variables - _keepRunningAssertionCounter = 0; - _shutdownPending = NO; - _assertionLock = OS_UNFAIR_LOCK_INIT; - _suspended = startSuspended; if (storageDelegate != nil) { @@ -478,75 +464,21 @@ - (void)_controllerResumed - (BOOL)matchesPendingShutdownControllerWithOperationalCertificate:(nullable MTRCertificateDERBytes)operationalCertificate andRootCertificate:(nullable MTRCertificateDERBytes)rootCertificate { - if (!operationalCertificate || !rootCertificate) { - return FALSE; - } - NSNumber * nodeID = [MTRDeviceControllerParameters nodeIDFromNOC:operationalCertificate]; - NSNumber * fabricID = [MTRDeviceControllerParameters fabricIDFromNOC:operationalCertificate]; - NSData * publicKey = [MTRDeviceControllerParameters publicKeyFromCertificate:rootCertificate]; - - std::lock_guard lock(_assertionLock); - - // If any of the local above are nil, the return will be false since MTREqualObjects handles them correctly - return _keepRunningAssertionCounter > 0 && _shutdownPending && MTREqualObjects(nodeID, self.nodeID) && MTREqualObjects(fabricID, self.fabricID) && MTREqualObjects(publicKey, self.rootPublicKey); -} - -- (void)addRunAssertion -{ - std::lock_guard lock(_assertionLock); - - // Only take an assertion if running - if ([self isRunning]) { - ++_keepRunningAssertionCounter; - MTR_LOG("%@ Adding keep running assertion, total %lu", self, static_cast(_keepRunningAssertionCounter)); - } -} - -- (void)removeRunAssertion; -{ - std::lock_guard lock(_assertionLock); - - if (_keepRunningAssertionCounter > 0) { - --_keepRunningAssertionCounter; - MTR_LOG("%@ Removing keep running assertion, total %lu", self, static_cast(_keepRunningAssertionCounter)); - - if ([self isRunning] && _keepRunningAssertionCounter == 0 && _shutdownPending) { - MTR_LOG("%@ All assertions removed and shutdown is pending, shutting down", self); - [self finalShutdown]; - } - } + // TODO: Once the factory knows it's dealing with MTRDeviceController_Concrete, this can be removed, and its + // declaration moved to MTRDeviceController_Concrete. + return NO; } - (void)clearPendingShutdown { - std::lock_guard lock(_assertionLock); - _shutdownPending = NO; + // TODO: Once the factory knows it's dealing with MTRDeviceController_Concrete, this can be removed, and its + // declaration moved to MTRDeviceController_Concrete. + MTR_ABSTRACT_METHOD(); } - (void)shutdown { - std::lock_guard lock(_assertionLock); - - if (_keepRunningAssertionCounter > 0) { - MTR_LOG("%@ Pending shutdown since %lu assertions are present", self, static_cast(_keepRunningAssertionCounter)); - _shutdownPending = YES; - return; - } - [self finalShutdown]; -} - -- (void)finalShutdown -{ - os_unfair_lock_assert_owner(&_assertionLock); - - MTR_LOG("%@ shutdown called", self); - if (_cppCommissioner == nullptr) { - // Already shut down. - return; - } - - MTR_LOG("Shutting down %@: %@", NSStringFromClass(self.class), self); - [self cleanupAfterStartup]; + MTR_ABSTRACT_METHOD(); } // Clean up from a state where startup was called. @@ -604,7 +536,6 @@ - (void)shutDownCppController _operationalCredentialsDelegate->SetDeviceCommissioner(nullptr); } } - _shutdownPending = NO; } - (void)deinitFromFactory diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index ee0f330b26cfc2..c44b6e3bfb25dc 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -1144,6 +1144,9 @@ - (nullable MTRDeviceController *)_findPendingShutdownControllerWithOperationalC { std::lock_guard lock(_controllersLock); for (MTRDeviceController * controller in _controllers) { + // TODO: Once we know our controllers are MTRDeviceController_Concrete, move + // matchesPendingShutdownControllerWithOperationalCertificate and clearPendingShutdown to that + // interface and remove them from base MTRDeviceController_Internal. if ([controller matchesPendingShutdownControllerWithOperationalCertificate:operationalCertificate andRootCertificate:rootCertificate]) { MTR_LOG("%@ Found existing controller %@ that is pending shutdown and matching parameters, re-using it", self, controller); [controller clearPendingShutdown]; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h index b491e3f140c85a..59dd42c04a97f4 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h @@ -23,6 +23,21 @@ NS_ASSUME_NONNULL_BEGIN @interface MTRDeviceController_Concrete : MTRDeviceController + +/** + * Takes an assertion to keep the controller running. If `-[MTRDeviceController shutdown]` is called while an assertion + * is held, the shutdown will be honored only after all assertions are released. Invoking this method multiple times increases + * the number of assertions and needs to be matched with equal amount of '-[MTRDeviceController removeRunAssertion]` to release + * the assertion. + */ +- (void)addRunAssertion; + +/** + * Removes an assertion to allow the controller to shutdown once all assertions have been released. + * Invoking this method once all assertions have been released in a noop. + */ +- (void)removeRunAssertion; + @end NS_ASSUME_NONNULL_END diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index 993298234f33ef..8eb21aef64eb9e 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -308,20 +308,6 @@ NS_ASSUME_NONNULL_BEGIN */ - (void)directlyGetSessionForNode:(chip::NodeId)nodeID completion:(MTRInternalDeviceConnectionCallback)completion; -/** - * Takes an assertion to keep the controller running. If `-[MTRDeviceController shutdown]` is called while an assertion - * is held, the shutdown will be honored only after all assertions are released. Invoking this method multiple times increases - * the number of assertions and needs to be matched with equal amount of '-[MTRDeviceController removeRunAssertion]` to release - * the assertion. - */ -- (void)addRunAssertion; - -/** - * Removes an assertion to allow the controller to shutdown once all assertions have been released. - * Invoking this method once all assertions have been released in a noop. - */ -- (void)removeRunAssertion; - /** * This method returns TRUE if this controller matches the fabric reference and node ID as listed in the parameters. */ From 8318df939b12549a1b1adee21d271e29cda09544 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 19 Sep 2024 16:49:20 -0400 Subject: [PATCH 36/47] Clean up MTRDeviceController initWithParameters dispatch. (#35677) --- .../Framework/CHIP/MTRDeviceController.mm | 31 +++++++---- .../CHIP/MTRDeviceControllerXPCParameters.h | 6 +-- .../CHIP/MTRDeviceControllerXPCParameters.mm | 16 +++--- .../CHIP/MTRDeviceController_Concrete.mm | 52 ++++--------------- src/darwin/Framework/CHIP/MTRDevice_XPC.mm | 1 - 5 files changed, 45 insertions(+), 61 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 4c3afe8412040b..83c6faeef7a337 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -32,8 +32,10 @@ #import "MTRDeviceControllerLocalTestStorage.h" #import "MTRDeviceControllerStartupParams.h" #import "MTRDeviceControllerStartupParams_Internal.h" +#import "MTRDeviceControllerXPCParameters.h" #import "MTRDeviceController_Concrete.h" #import "MTRDeviceController_XPC.h" +#import "MTRDeviceController_XPC_Internal.h" #import "MTRDevice_Concrete.h" #import "MTRDevice_Internal.h" #import "MTRError_Internal.h" @@ -190,20 +192,31 @@ - (instancetype)initForSubclasses:(BOOL)startSuspended - (nullable MTRDeviceController *)initWithParameters:(MTRDeviceControllerAbstractParameters *)parameters error:(NSError * __autoreleasing *)error { + // Dispatch to the right non-abstract implementation. if ([parameters isKindOfClass:MTRXPCDeviceControllerParameters.class]) { MTR_LOG("Starting up with XPC Device Controller Parameters: %@", parameters); return [[MTRDeviceController_XPC alloc] initWithParameters:parameters error:error]; - } else if (![parameters isKindOfClass:MTRDeviceControllerParameters.class]) { - MTR_LOG_ERROR("Unsupported type of MTRDeviceControllerAbstractParameters: %@", parameters); - if (error) { - *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT]; - } - return nil; } - auto * controllerParameters = static_cast(parameters); - // MTRDeviceControllerFactory will auto-start in per-controller-storage mode if necessary - return [MTRDeviceControllerFactory.sharedInstance initializeController:[MTRDeviceController_Concrete alloc] withParameters:controllerParameters error:error]; + if ([parameters isKindOfClass:MTRDeviceControllerMachServiceXPCParameters.class]) { + // TODO: This will need to at least pass in the uniqueIdentifier, no? initWithMachServiceName:options: seems to + // be declared but not actually implemented... + auto * xpcParameters = static_cast(parameters); + + MTR_LOG("Starting up with Mach Service XPC Device Controller Parameters: %@", parameters); + return [[MTRDeviceController_XPC alloc] initWithMachServiceName:xpcParameters.machServiceName options:xpcParameters.connectionOptions]; + } + + if ([parameters isKindOfClass:MTRDeviceControllerParameters.class]) { + MTR_LOG("Starting up with Device Controller Parameters: %@", parameters); + return [[MTRDeviceController_Concrete alloc] initWithParameters:parameters error:error]; + } + + MTR_LOG_ERROR("Unsupported type of MTRDeviceControllerAbstractParameters: %@", parameters); + if (error) { + *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT]; + } + return nil; } - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerXPCParameters.h b/src/darwin/Framework/CHIP/MTRDeviceControllerXPCParameters.h index 9218ff2a990dcd..ac58e30cf0851a 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerXPCParameters.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerXPCParameters.h @@ -18,11 +18,11 @@ NS_ASSUME_NONNULL_BEGIN -@interface MTRDeviceControllerXPCParameters : MTRDeviceControllerParameters -@end +@interface MTRDeviceControllerMachServiceXPCParameters : MTRDeviceControllerAbstractParameters -@interface MTRDeviceControllerMachServiceXPCParameters : MTRDeviceControllerXPCParameters +- (nullable instancetype)initWithUniqueIdentifier:(NSUUID *)uniqueIdentifier; +@property (atomic, retain) NSUUID * uniqueIdentifier; @property (atomic, retain) NSString * machServiceName; @property (atomic, readwrite) NSXPCConnectionOptions connectionOptions; diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerXPCParameters.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerXPCParameters.mm index 5178873ec27f1e..df3c7a8ed15eab 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerXPCParameters.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerXPCParameters.mm @@ -15,17 +15,19 @@ */ #import "MTRDeviceControllerXPCParameters.h" +#import "MTRDeviceControllerStartupParams_Internal.h" -@implementation MTRDeviceControllerXPCParameters +@implementation MTRDeviceControllerMachServiceXPCParameters -+ (BOOL)supportsSecureCoding +- (nullable instancetype)initWithUniqueIdentifier:(NSUUID *)uniqueIdentifier { - return YES; -} + if (!(self = [super _initInternal])) { + return nil; + } -@end - -@implementation MTRDeviceControllerMachServiceXPCParameters + _uniqueIdentifier = uniqueIdentifier; + return self; +} + (BOOL)supportsSecureCoding { diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index 97f47a50faca06..8784b61d63cb88 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -31,10 +31,7 @@ #import "MTRDeviceControllerLocalTestStorage.h" #import "MTRDeviceControllerStartupParams.h" #import "MTRDeviceControllerStartupParams_Internal.h" -#import "MTRDeviceControllerXPCParameters.h" #import "MTRDeviceController_Concrete.h" -#import "MTRDeviceController_XPC.h" -#import "MTRDeviceController_XPC_Internal.h" #import "MTRDevice_Concrete.h" #import "MTRDevice_Internal.h" #import "MTRError_Internal.h" @@ -148,49 +145,22 @@ @implementation MTRDeviceController_Concrete { - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParameters *)parameters error:(NSError * __autoreleasing *)error { - /// IF YOU ARE ALARMED BY TYPES: You are right to be alarmed, but do not panic. - /// _ORDER MATTERS HERE:_ XPC parameters are a subclass of `MTRDeviceControllerParameters` - /// because of the enormous overlap of params. - if ([parameters isKindOfClass:MTRDeviceControllerXPCParameters.class]) { - if ([parameters isKindOfClass:MTRDeviceControllerMachServiceXPCParameters.class]) { - MTRDeviceControllerMachServiceXPCParameters * xpcParameters = (MTRDeviceControllerMachServiceXPCParameters *) parameters; - MTR_LOG_DEBUG("%s: got XPC parameters, getting XPC device controller", __PRETTY_FUNCTION__); - - NSString * machServiceName = xpcParameters.machServiceName; - MTR_LOG_DEBUG("%s: machServiceName %@", __PRETTY_FUNCTION__, machServiceName); - - MTRDeviceController * xpcDeviceController = [[MTRDeviceController_XPC alloc] initWithMachServiceName:machServiceName options:xpcParameters.connectionOptions]; - - /// Being of sound mind, I willfully and voluntarily make this static cast. - return static_cast(xpcDeviceController); - } else { - MTR_LOG_ERROR("%s: unrecognized XPC parameters class %@", __PRETTY_FUNCTION__, NSStringFromClass(parameters.class)); - - // TODO: there's probably a more appropriate error here. - if (error) { - *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_NOT_IMPLEMENTED]; - } - - return nil; - } - } else if ([parameters isKindOfClass:MTRDeviceControllerParameters.class]) { - MTR_LOG_DEBUG("%s: got standard parameters, getting standard device controller from factory", __PRETTY_FUNCTION__); - auto * controllerParameters = static_cast(parameters); - - // Start us up normally. MTRDeviceControllerFactory will auto-start in per-controller-storage mode if necessary. - MTRDeviceControllerFactory * factory = MTRDeviceControllerFactory.sharedInstance; - id controller = [factory initializeController:self - withParameters:controllerParameters - error:error]; - return controller; - } else { - // way out of our league - MTR_LOG_ERROR("Unsupported type of MTRDeviceControllerAbstractParameters: %@", parameters); + if (![parameters isKindOfClass:MTRDeviceControllerParameters.class]) { + MTR_LOG_ERROR("Expected MTRDeviceControllerParameters but got: %@", parameters); if (error) { *error = [MTRError errorForCHIPErrorCode:CHIP_ERROR_INVALID_ARGUMENT]; } return nil; } + + auto * controllerParameters = static_cast(parameters); + + // Start us up normally. MTRDeviceControllerFactory will auto-start in per-controller-storage mode if necessary. + MTRDeviceControllerFactory * factory = MTRDeviceControllerFactory.sharedInstance; + id controller = [factory initializeController:self + withParameters:controllerParameters + error:error]; + return controller; } - (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory diff --git a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm index a8d9a48e9cbb35..0827ee46602449 100644 --- a/src/darwin/Framework/CHIP/MTRDevice_XPC.mm +++ b/src/darwin/Framework/CHIP/MTRDevice_XPC.mm @@ -39,7 +39,6 @@ #import "MTRDeviceControllerLocalTestStorage.h" #import "MTRDeviceControllerStartupParams.h" #import "MTRDeviceControllerStartupParams_Internal.h" -#import "MTRDeviceControllerXPCParameters.h" #import "MTRDeviceController_Concrete.h" #import "MTRDeviceController_XPC.h" #import "MTRDevice_Concrete.h" From c845e54be4cf3b3e2a8fdea95c630311c61f1a00 Mon Sep 17 00:00:00 2001 From: Andrei Litvin Date: Thu, 19 Sep 2024 18:17:36 -0400 Subject: [PATCH 37/47] Additional socket checks for socket inet implementations (#35674) * Additional socket checks for socket inet implementations * Self-review update * One more extra check to make clang-tidy happy * Switch to nolint * Avoid large code deltas * Restyle * Restyled by clang-format --------- Co-authored-by: Andrei Litvin Co-authored-by: Restyled.io --- src/inet/TCPEndPointImplSockets.cpp | 2 ++ src/inet/UDPEndPointImplSockets.cpp | 5 +++++ 2 files changed, 7 insertions(+) diff --git a/src/inet/TCPEndPointImplSockets.cpp b/src/inet/TCPEndPointImplSockets.cpp index 6b8965b19d2b4b..96cdc67d73674c 100644 --- a/src/inet/TCPEndPointImplSockets.cpp +++ b/src/inet/TCPEndPointImplSockets.cpp @@ -127,6 +127,7 @@ CHIP_ERROR TCPEndPointImplSockets::BindImpl(IPAddressType addrType, const IPAddr if (res == CHIP_NO_ERROR) { + // NOLINTNEXTLINE(clang-analyzer-unix.StdCLibraryFunctions): GetSocket calls ensure mSocket is valid if (bind(mSocket, &sa.any, sockaddrsize) != 0) { res = CHIP_ERROR_POSIX(errno); @@ -248,6 +249,7 @@ CHIP_ERROR TCPEndPointImplSockets::ConnectImpl(const IPAddress & addr, uint16_t return INET_ERROR_WRONG_ADDRESS_TYPE; } + // NOLINTNEXTLINE(clang-analyzer-unix.StdCLibraryFunctions): GetSocket calls ensure mSocket is valid int conRes = connect(mSocket, &sa.any, sockaddrsize); if (conRes == -1 && errno != EINPROGRESS) diff --git a/src/inet/UDPEndPointImplSockets.cpp b/src/inet/UDPEndPointImplSockets.cpp index c80db4d771b10f..31b16c0f8ec192 100644 --- a/src/inet/UDPEndPointImplSockets.cpp +++ b/src/inet/UDPEndPointImplSockets.cpp @@ -106,6 +106,8 @@ CHIP_ERROR IPv6Bind(int socket, const IPAddress & address, uint16_t port, Interf sa.sin6_scope_id = static_cast(interfaceId); CHIP_ERROR status = CHIP_NO_ERROR; + + // NOLINTNEXTLINE(clang-analyzer-unix.StdCLibraryFunctions): Function called only with valid socket after GetSocket if (bind(socket, reinterpret_cast(&sa), static_cast(sizeof(sa))) != 0) { status = CHIP_ERROR_POSIX(errno); @@ -139,6 +141,8 @@ CHIP_ERROR IPv4Bind(int socket, const IPAddress & address, uint16_t port) sa.sin_addr = address.ToIPv4(); CHIP_ERROR status = CHIP_NO_ERROR; + + // NOLINTNEXTLINE(clang-analyzer-unix.StdCLibraryFunctions): Function called only with valid socket after GetSocket if (bind(socket, reinterpret_cast(&sa), static_cast(sizeof(sa))) != 0) { status = CHIP_ERROR_POSIX(errno); @@ -410,6 +414,7 @@ CHIP_ERROR UDPEndPointImplSockets::SendMsgImpl(const IPPacketInfo * aPktInfo, Sy #endif // INET_CONFIG_UDP_SOCKET_PKTINFO // Send IP packet. + // NOLINTNEXTLINE(clang-analyzer-unix.StdCLibraryFunctions): GetSocket calls ensure mSocket is valid const ssize_t lenSent = sendmsg(mSocket, &msgHeader, 0); if (lenSent == -1) { From 204b1fb266f33e5cbf845ed0c59b99ae8efe0612 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 19 Sep 2024 20:05:13 -0400 Subject: [PATCH 38/47] MTRDeviceControllerOverXPC should inherit from MTRDeviceController_Concrete for now. (#35685) That's what it used to do, and for now we should just leave it be. Longer-term, we need to figure out what should happen with MTRDeviceControllerOverXPC; whether it should inherit from the base MTRDeviceController, or just not exist, or what. --- src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.h b/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.h index 9616e22b7a494c..669baea9588f57 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerOverXPC.h @@ -16,7 +16,8 @@ */ #import -#import + +#import "MTRDeviceController_Concrete.h" NS_ASSUME_NONNULL_BEGIN @@ -24,7 +25,7 @@ NS_ASSUME_NONNULL_BEGIN typedef NSXPCConnection * _Nonnull (^MTRXPCConnectBlock)(void); -@interface MTRDeviceControllerOverXPC : MTRDeviceController +@interface MTRDeviceControllerOverXPC : MTRDeviceController_Concrete - (instancetype)init NS_UNAVAILABLE; + (instancetype)new NS_UNAVAILABLE; From dffaaf007fb905b0ac46b2e3c5b69591d972f43f Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 19 Sep 2024 20:38:02 -0400 Subject: [PATCH 39/47] Move initWithFactory: and startup: declarations to MTRDeviceController_Concrete. (#35683) initWithFactory: and startup: are only called from _startDeviceController:, which was only being called with MTRDeviceController_Concrete instances. Also fixes the argument type declarations for _startDeviceController: and initializeController: to make the types compile-time enforced. The MTRDeviceController implementations of initWithFactory: and startup: are now obviously unreachable and can be removed. Some static variables that are now unused have to be removed so the compiler doesn't complain about them. Further cleanup of now-unused things will follow in separate PRs. --- .../Framework/CHIP/MTRDeviceController.mm | 410 ------------------ .../CHIP/MTRDeviceControllerFactory.mm | 6 +- .../MTRDeviceControllerFactory_Internal.h | 5 +- .../CHIP/MTRDeviceController_Concrete.h | 30 ++ .../CHIP/MTRDeviceController_Concrete.mm | 20 +- .../CHIP/MTRDeviceController_Internal.h | 30 -- 6 files changed, 46 insertions(+), 455 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index 83c6faeef7a337..aaf1289f184f98 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -88,26 +88,15 @@ // TODO: These strings and their consumers in this file should probably go away, // since none of them really apply to all controllers. -static NSString * const kErrorCommissionerInit = @"Init failure while initializing a commissioner"; -static NSString * const kErrorIPKInit = @"Init failure while initializing IPK"; -static NSString * const kErrorSigningKeypairInit = @"Init failure while creating signing keypair bridge"; -static NSString * const kErrorOperationalCredentialsInit = @"Init failure while creating operational credentials delegate"; -static NSString * const kErrorOperationalKeypairInit = @"Init failure while creating operational keypair bridge"; -static NSString * const kErrorPairingInit = @"Init failure while creating a pairing delegate"; -static NSString * const kErrorPartialDacVerifierInit = @"Init failure while creating a partial DAC verifier"; static NSString * const kErrorPairDevice = @"Failure while pairing the device"; static NSString * const kErrorStopPairing = @"Failure while trying to stop the pairing process"; static NSString * const kErrorOpenPairingWindow = @"Open Pairing Window failed"; static NSString * const kErrorNotRunning = @"Controller is not running. Call startup first."; static NSString * const kErrorSetupCodeGen = @"Generating Manual Pairing Code failed"; -static NSString * const kErrorGenerateNOC = @"Generating operational certificate failed"; -static NSString * const kErrorKeyAllocation = @"Generating new operational key failed"; -static NSString * const kErrorCSRValidation = @"Extracting public key from CSR failed"; static NSString * const kErrorGetCommissionee = @"Failure obtaining device being commissioned"; static NSString * const kErrorGetAttestationChallenge = @"Failure getting attestation challenge"; static NSString * const kErrorSpake2pVerifierGenerationFailed = @"PASE verifier generation failed"; static NSString * const kErrorSpake2pVerifierSerializationFailed = @"PASE verifier serialization failed"; -static NSString * const kErrorCDCertStoreInit = @"Init failure while initializing Certificate Declaration Signing Keys store"; typedef void (^SyncWorkQueueBlock)(void); typedef id (^SyncWorkQueueBlockWithReturnValue)(void); @@ -219,150 +208,6 @@ - (nullable MTRDeviceController *)initWithParameters:(MTRDeviceControllerAbstrac return nil; } -- (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory - queue:(dispatch_queue_t)queue - storageDelegate:(id _Nullable)storageDelegate - storageDelegateQueue:(dispatch_queue_t _Nullable)storageDelegateQueue - otaProviderDelegate:(id _Nullable)otaProviderDelegate - otaProviderDelegateQueue:(dispatch_queue_t _Nullable)otaProviderDelegateQueue - uniqueIdentifier:(NSUUID *)uniqueIdentifier - concurrentSubscriptionPoolSize:(NSUInteger)concurrentSubscriptionPoolSize - storageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration *)storageBehaviorConfiguration - startSuspended:(BOOL)startSuspended -{ - if (self = [super init]) { - // Make sure our storage is all set up to work as early as possible, - // before we start doing anything else with the controller. - _uniqueIdentifier = uniqueIdentifier; - - _suspended = startSuspended; - - if (storageDelegate != nil) { - if (storageDelegateQueue == nil) { - MTR_LOG_ERROR("storageDelegate provided without storageDelegateQueue"); - return nil; - } - - id storageDelegateToUse = storageDelegate; - if (MTRDeviceControllerLocalTestStorage.localTestStorageEnabled) { - storageDelegateToUse = [[MTRDeviceControllerLocalTestStorage alloc] initWithPassThroughStorage:storageDelegate]; - } - _controllerDataStore = [[MTRDeviceControllerDataStore alloc] initWithController:self - storageDelegate:storageDelegateToUse - storageDelegateQueue:storageDelegateQueue]; - if (_controllerDataStore == nil) { - return nil; - } - } else { - if (MTRDeviceControllerLocalTestStorage.localTestStorageEnabled) { - dispatch_queue_t localTestStorageQueue = dispatch_queue_create("org.csa-iot.matter.framework.devicecontroller.localteststorage", DISPATCH_QUEUE_SERIAL_WITH_AUTORELEASE_POOL); - MTRDeviceControllerLocalTestStorage * localTestStorage = [[MTRDeviceControllerLocalTestStorage alloc] initWithPassThroughStorage:nil]; - _controllerDataStore = [[MTRDeviceControllerDataStore alloc] initWithController:self - storageDelegate:localTestStorage - storageDelegateQueue:localTestStorageQueue]; - if (_controllerDataStore == nil) { - return nil; - } - } - } - - // Ensure the otaProviderDelegate, if any, is valid. - if (otaProviderDelegate == nil && otaProviderDelegateQueue != nil) { - MTR_LOG_ERROR("Must have otaProviderDelegate when we have otaProviderDelegateQueue"); - return nil; - } - - if (otaProviderDelegate != nil && otaProviderDelegateQueue == nil) { - MTR_LOG_ERROR("Must have otaProviderDelegateQueue when we have otaProviderDelegate"); - return nil; - } - - if (otaProviderDelegate != nil) { - if (![otaProviderDelegate respondsToSelector:@selector(handleQueryImageForNodeID:controller:params:completion:)] - && ![otaProviderDelegate respondsToSelector:@selector(handleQueryImageForNodeID:controller:params:completionHandler:)]) { - MTR_LOG_ERROR("Error: MTROTAProviderDelegate does not support handleQueryImageForNodeID"); - return nil; - } - if (![otaProviderDelegate respondsToSelector:@selector(handleApplyUpdateRequestForNodeID:controller:params:completion:)] - && ![otaProviderDelegate respondsToSelector:@selector(handleApplyUpdateRequestForNodeID:controller:params:completionHandler:)]) { - MTR_LOG_ERROR("Error: MTROTAProviderDelegate does not support handleApplyUpdateRequestForNodeID"); - return nil; - } - if (![otaProviderDelegate respondsToSelector:@selector(handleNotifyUpdateAppliedForNodeID:controller:params:completion:)] - && ![otaProviderDelegate - respondsToSelector:@selector(handleNotifyUpdateAppliedForNodeID:controller:params:completionHandler:)]) { - MTR_LOG_ERROR("Error: MTROTAProviderDelegate does not support handleNotifyUpdateAppliedForNodeID"); - return nil; - } - if (![otaProviderDelegate respondsToSelector:@selector(handleBDXTransferSessionBeginForNodeID:controller:fileDesignator:offset:completion:)] - && ![otaProviderDelegate respondsToSelector:@selector(handleBDXTransferSessionBeginForNodeID:controller:fileDesignator:offset:completionHandler:)]) { - MTR_LOG_ERROR("Error: MTROTAProviderDelegate does not support handleBDXTransferSessionBeginForNodeID"); - return nil; - } - if (![otaProviderDelegate respondsToSelector:@selector(handleBDXQueryForNodeID:controller:blockSize:blockIndex:bytesToSkip:completion:)] - && ![otaProviderDelegate respondsToSelector:@selector(handleBDXQueryForNodeID:controller:blockSize:blockIndex:bytesToSkip:completionHandler:)]) { - MTR_LOG_ERROR("Error: MTROTAProviderDelegate does not support handleBDXQueryForNodeID"); - return nil; - } - } - - _otaProviderDelegate = otaProviderDelegate; - _otaProviderDelegateQueue = otaProviderDelegateQueue; - - _chipWorkQueue = queue; - _factory = factory; - _underlyingDeviceMapLock = OS_UNFAIR_LOCK_INIT; - _nodeIDToDeviceMap = [NSMapTable strongToWeakObjectsMapTable]; - _serverEndpoints = [[NSMutableArray alloc] init]; - _commissionableBrowser = nil; - - _deviceControllerDelegateBridge = new MTRDeviceControllerDelegateBridge(); - if ([self checkForInitError:(_deviceControllerDelegateBridge != nullptr) logMsg:kErrorPairingInit]) { - return nil; - } - - _partialDACVerifier = new chip::Credentials::PartialDACVerifier(); - if ([self checkForInitError:(_partialDACVerifier != nullptr) logMsg:kErrorPartialDacVerifierInit]) { - return nil; - } - - _operationalCredentialsDelegate = new MTROperationalCredentialsDelegate(self); - if ([self checkForInitError:(_operationalCredentialsDelegate != nullptr) logMsg:kErrorOperationalCredentialsInit]) { - return nil; - } - - // Provide a way to test different subscription pool sizes without code change - NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults]; - if ([defaults objectForKey:kDefaultSubscriptionPoolSizeOverrideKey]) { - NSInteger subscriptionPoolSizeOverride = [defaults integerForKey:kDefaultSubscriptionPoolSizeOverrideKey]; - if (subscriptionPoolSizeOverride < 1) { - concurrentSubscriptionPoolSize = 1; - } else { - concurrentSubscriptionPoolSize = static_cast(subscriptionPoolSizeOverride); - } - - MTR_LOG(" *** Overriding pool size of MTRDeviceController with: %lu", static_cast(concurrentSubscriptionPoolSize)); - } - - if (!concurrentSubscriptionPoolSize) { - concurrentSubscriptionPoolSize = 1; - } - - MTR_LOG("%@ Setting up pool size of MTRDeviceController with: %lu", self, static_cast(concurrentSubscriptionPoolSize)); - - _concurrentSubscriptionPool = [[MTRAsyncWorkQueue alloc] initWithContext:self width:concurrentSubscriptionPoolSize]; - - _storedFabricIndex = chip::kUndefinedFabricIndex; - _storedCompressedFabricID = std::nullopt; - self.nodeID = nil; - self.fabricID = nil; - self.rootPublicKey = nil; - - _storageBehaviorConfiguration = storageBehaviorConfiguration; - } - return self; -} - - (NSString *)description { return [NSString stringWithFormat:@"<%@: %p, uuid: %@, suspended: %@>", NSStringFromClass(self.class), self, self.uniqueIdentifier, MTR_YES_NO(self.suspended)]; @@ -593,261 +438,6 @@ - (void)cleanup } } -- (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams -{ - __block BOOL commissionerInitialized = NO; - if ([self isRunning]) { - MTR_LOG_ERROR("%@ Unexpected duplicate call to startup", self); - return NO; - } - - dispatch_sync(_chipWorkQueue, ^{ - if ([self isRunning]) { - return; - } - - if (startupParams.vendorID == nil || [startupParams.vendorID unsignedShortValue] == chip::VendorId::Common) { - // Shouldn't be using the "standard" vendor ID for actual devices. - MTR_LOG_ERROR("%@ %@ is not a valid vendorID to initialize a device controller with", self, startupParams.vendorID); - return; - } - - if (startupParams.operationalCertificate == nil && startupParams.nodeID == nil) { - MTR_LOG_ERROR("%@ Can't start a controller if we don't know what node id it is", self); - return; - } - - if ([startupParams keypairsMatchCertificates] == NO) { - MTR_LOG_ERROR("%@ Provided keypairs do not match certificates", self); - return; - } - - if (startupParams.operationalCertificate != nil && startupParams.operationalKeypair == nil - && (!startupParams.fabricIndex.HasValue() - || !startupParams.keystore->HasOpKeypairForFabric(startupParams.fabricIndex.Value()))) { - MTR_LOG_ERROR("%@ Have no operational keypair for our operational certificate", self); - return; - } - - CHIP_ERROR errorCode = CHIP_ERROR_INCORRECT_STATE; - - // create a MTRP256KeypairBridge here and pass it to the operationalCredentialsDelegate - chip::Crypto::P256Keypair * signingKeypair = nullptr; - if (startupParams.nocSigner) { - errorCode = _signingKeypairBridge.Init(startupParams.nocSigner); - if ([self checkForStartError:errorCode logMsg:kErrorSigningKeypairInit]) { - return; - } - signingKeypair = &_signingKeypairBridge; - } - errorCode = _operationalCredentialsDelegate->Init( - signingKeypair, startupParams.ipk, startupParams.rootCertificate, startupParams.intermediateCertificate); - if ([self checkForStartError:errorCode logMsg:kErrorOperationalCredentialsInit]) { - return; - } - - _cppCommissioner = new chip::Controller::DeviceCommissioner(); - - // nocBuffer might not be used, but if it is it needs to live - // long enough (until after we are done using - // commissionerParams). - uint8_t nocBuffer[chip::Controller::kMaxCHIPDERCertLength]; - - chip::Controller::SetupParams commissionerParams; - - commissionerParams.pairingDelegate = _deviceControllerDelegateBridge; - - _operationalCredentialsDelegate->SetDeviceCommissioner(_cppCommissioner); - - commissionerParams.operationalCredentialsDelegate = _operationalCredentialsDelegate; - - commissionerParams.controllerRCAC = _operationalCredentialsDelegate->RootCertSpan(); - commissionerParams.controllerICAC = _operationalCredentialsDelegate->IntermediateCertSpan(); - - if (startupParams.operationalKeypair != nil) { - errorCode = _operationalKeypairBridge.Init(startupParams.operationalKeypair); - if ([self checkForStartError:errorCode logMsg:kErrorOperationalKeypairInit]) { - return; - } - commissionerParams.operationalKeypair = &_operationalKeypairBridge; - commissionerParams.hasExternallyOwnedOperationalKeypair = true; - } - - if (startupParams.operationalCertificate) { - commissionerParams.controllerNOC = AsByteSpan(startupParams.operationalCertificate); - } else { - chip::MutableByteSpan noc(nocBuffer); - - chip::CATValues cats = chip::kUndefinedCATs; - if (startupParams.caseAuthenticatedTags != nil) { - errorCode = SetToCATValues(startupParams.caseAuthenticatedTags, cats); - if (errorCode != CHIP_NO_ERROR) { - // SetToCATValues already handles logging. - return; - } - } - - if (commissionerParams.operationalKeypair != nullptr) { - errorCode = _operationalCredentialsDelegate->GenerateNOC(startupParams.nodeID.unsignedLongLongValue, - startupParams.fabricID.unsignedLongLongValue, cats, commissionerParams.operationalKeypair->Pubkey(), noc); - - if ([self checkForStartError:errorCode logMsg:kErrorGenerateNOC]) { - return; - } - } else { - // Generate a new random keypair. - uint8_t csrBuffer[chip::Crypto::kMIN_CSR_Buffer_Size]; - chip::MutableByteSpan csr(csrBuffer); - errorCode = startupParams.fabricTable->AllocatePendingOperationalKey(startupParams.fabricIndex, csr); - if ([self checkForStartError:errorCode logMsg:kErrorKeyAllocation]) { - return; - } - - chip::Crypto::P256PublicKey pubKey; - errorCode = VerifyCertificateSigningRequest(csr.data(), csr.size(), pubKey); - if ([self checkForStartError:errorCode logMsg:kErrorCSRValidation]) { - return; - } - - errorCode = _operationalCredentialsDelegate->GenerateNOC( - startupParams.nodeID.unsignedLongLongValue, startupParams.fabricID.unsignedLongLongValue, cats, pubKey, noc); - - if ([self checkForStartError:errorCode logMsg:kErrorGenerateNOC]) { - return; - } - } - commissionerParams.controllerNOC = noc; - } - commissionerParams.controllerVendorId = static_cast([startupParams.vendorID unsignedShortValue]); - commissionerParams.enableServerInteractions = startupParams.advertiseOperational; - - // We never want plain "removal" from the fabric table since this leaves - // the in-memory state out of sync with what's in storage. In per-controller - // storage mode, have the controller delete itself from the fabric table on shutdown. - // In factory storage mode we need to keep fabric information around so we can - // start another controller on that existing fabric at a later time. - commissionerParams.removeFromFabricTableOnShutdown = false; - commissionerParams.deleteFromFabricTableOnShutdown = (startupParams.storageDelegate != nil); - - commissionerParams.permitMultiControllerFabrics = startupParams.allowMultipleControllersPerFabric; - - // Set up our attestation verifier. Assume we want to use the default - // one, until something tells us otherwise. - const chip::Credentials::AttestationTrustStore * trustStore; - if (startupParams.productAttestationAuthorityCertificates) { - _attestationTrustStoreBridge - = new MTRAttestationTrustStoreBridge(startupParams.productAttestationAuthorityCertificates); - trustStore = _attestationTrustStoreBridge; - } else { - // TODO: Replace testingRootStore with a AttestationTrustStore that has the necessary official PAA roots available - trustStore = chip::Credentials::GetTestAttestationTrustStore(); - } - - _defaultDACVerifier = new chip::Credentials::DefaultDACVerifier(trustStore); - - if (startupParams.certificationDeclarationCertificates) { - auto cdTrustStore = _defaultDACVerifier->GetCertificationDeclarationTrustStore(); - if (cdTrustStore == nullptr) { - errorCode = CHIP_ERROR_INCORRECT_STATE; - } - if ([self checkForStartError:errorCode logMsg:kErrorCDCertStoreInit]) { - return; - } - - for (NSData * cdSigningCert in startupParams.certificationDeclarationCertificates) { - errorCode = cdTrustStore->AddTrustedKey(AsByteSpan(cdSigningCert)); - if ([self checkForStartError:errorCode logMsg:kErrorCDCertStoreInit]) { - return; - } - } - } - - commissionerParams.deviceAttestationVerifier = _defaultDACVerifier; - - auto & factory = chip::Controller::DeviceControllerFactory::GetInstance(); - - errorCode = factory.SetupCommissioner(commissionerParams, *_cppCommissioner); - if ([self checkForStartError:errorCode logMsg:kErrorCommissionerInit]) { - return; - } - - chip::FabricIndex fabricIdx = _cppCommissioner->GetFabricIndex(); - - uint8_t compressedIdBuffer[sizeof(uint64_t)]; - chip::MutableByteSpan compressedId(compressedIdBuffer); - errorCode = _cppCommissioner->GetCompressedFabricIdBytes(compressedId); - if ([self checkForStartError:errorCode logMsg:kErrorIPKInit]) { - return; - } - - errorCode = chip::Credentials::SetSingleIpkEpochKey( - _factory.groupDataProvider, fabricIdx, _operationalCredentialsDelegate->GetIPK(), compressedId); - if ([self checkForStartError:errorCode logMsg:kErrorIPKInit]) { - return; - } - - self->_storedFabricIndex = fabricIdx; - self->_storedCompressedFabricID = _cppCommissioner->GetCompressedFabricId(); - - chip::Crypto::P256PublicKey rootPublicKey; - if (_cppCommissioner->GetRootPublicKey(rootPublicKey) == CHIP_NO_ERROR) { - self.rootPublicKey = [NSData dataWithBytes:rootPublicKey.Bytes() length:rootPublicKey.Length()]; - self.nodeID = @(_cppCommissioner->GetNodeId()); - self.fabricID = @(_cppCommissioner->GetFabricId()); - } - - commissionerInitialized = YES; - - MTR_LOG("%@ startup succeeded for nodeID 0x%016llX", self, self->_cppCommissioner->GetNodeId()); - }); - - if (commissionerInitialized == NO) { - MTR_LOG_ERROR("%@ startup failed", self); - [self cleanupAfterStartup]; - return NO; - } - - // TODO: Once setNocChainIssuer no longer needs to be supported, - // we can just move the internals of - // setOperationalCertificateIssuer into the sync-dispatched block - // above. - if (![self setOperationalCertificateIssuer:startupParams.operationalCertificateIssuer - queue:startupParams.operationalCertificateIssuerQueue]) { - MTR_LOG_ERROR("%@ operationalCertificateIssuer and operationalCertificateIssuerQueue must both be nil or both be non-nil", self); - [self cleanupAfterStartup]; - return NO; - } - - if (_controllerDataStore) { - // If the storage delegate supports the bulk read API, then a dictionary of nodeID => cluster data dictionary would be passed to the handler. Otherwise this would be a no-op, and stored attributes for MTRDevice objects will be loaded lazily in -deviceForNodeID:. - [_controllerDataStore fetchAttributeDataForAllDevices:^(NSDictionary *> * _Nonnull clusterDataByNode) { - MTR_LOG("%@ Loaded attribute values for %lu nodes from storage for controller uuid %@", self, static_cast(clusterDataByNode.count), self->_uniqueIdentifier); - - std::lock_guard lock(*self.deviceMapLock); - NSMutableArray * deviceList = [NSMutableArray array]; - for (NSNumber * nodeID in clusterDataByNode) { - NSDictionary * clusterData = clusterDataByNode[nodeID]; - MTRDevice * device = [self _setupDeviceForNodeID:nodeID prefetchedClusterData:clusterData]; - MTR_LOG("%@ Loaded %lu cluster data from storage for %@", self, static_cast(clusterData.count), device); - - [deviceList addObject:device]; - } - -#define kSecondsToWaitBeforeAPIClientRetainsMTRDevice 60 - // Keep the devices retained for a while, in case API client doesn't immediately retain them. - // - // Note that this is just an optimization to avoid throwing the information away and immediately - // re-reading it from storage. - dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t) (kSecondsToWaitBeforeAPIClientRetainsMTRDevice * NSEC_PER_SEC)), dispatch_get_global_queue(QOS_CLASS_DEFAULT, 0), ^{ - MTR_LOG("%@ un-retain devices loaded at startup %lu", self, static_cast(deviceList.count)); - }); - }]; - } - MTR_LOG("%@ startup: %@", NSStringFromClass(self.class), self); - - return YES; -} - - (NSNumber *)controllerNodeID { auto block = ^NSNumber * { return @(self->_cppCommissioner->GetNodeId()); }; diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm index c44b6e3bfb25dc..d052eef51d0414 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory.mm @@ -461,7 +461,7 @@ - (void)stopControllerFactory * The provided controller is expected to have just been allocated and to not be * initialized yet. */ -- (MTRDeviceController * _Nullable)_startDeviceController:(MTRDeviceController *)controller +- (MTRDeviceController * _Nullable)_startDeviceController:(MTRDeviceController_Concrete *)controller startupParams:(id)startupParams fabricChecker:(MTRDeviceControllerStartupParamsInternal * (^)(FabricTable * fabricTable, MTRDeviceController * controller, @@ -834,7 +834,7 @@ - (BOOL)findMatchingFabric:(FabricTable &)fabricTable // Returns nil on failure, the input controller on success. // If the provider has been initialized already, it is not considered as a failure. // -- (MTRDeviceController * _Nullable)maybeInitializeOTAProvider:(MTRDeviceController * _Nonnull)controller +- (MTRDeviceController_Concrete * _Nullable)maybeInitializeOTAProvider:(MTRDeviceController_Concrete * _Nonnull)controller { [self _assertCurrentQueueIsNotMatterQueue]; @@ -1156,7 +1156,7 @@ - (nullable MTRDeviceController *)_findPendingShutdownControllerWithOperationalC return nil; } -- (nullable MTRDeviceController *)initializeController:(MTRDeviceController *)controller +- (nullable MTRDeviceController *)initializeController:(MTRDeviceController_Concrete *)controller withParameters:(MTRDeviceControllerParameters *)parameters error:(NSError * __autoreleasing *)error { diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h index 7c59a65dba42c2..55c67ed8043c70 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerFactory_Internal.h @@ -30,6 +30,7 @@ #import "MTRDefines_Internal.h" #import "MTRDeviceControllerFactory.h" +#import "MTRDeviceController_Concrete.h" #import "MTROperationalBrowser.h" #include @@ -89,9 +90,9 @@ MTR_DIRECT_MEMBERS completion:(void (^)(NSURL * _Nullable url, NSError * _Nullable error))completion; /** - * Initialize an MTRDeviceController with the given parameters. + * Initialize an MTRDeviceController_Concrete with the given parameters. */ -- (nullable MTRDeviceController *)initializeController:(MTRDeviceController *)controller +- (nullable MTRDeviceController *)initializeController:(MTRDeviceController_Concrete *)controller withParameters:(MTRDeviceControllerParameters *)parameters error:(NSError * __autoreleasing *)error; diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h index 59dd42c04a97f4..615765fc84dae1 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h @@ -20,10 +20,40 @@ #import #import +#import "MTRDeviceControllerStartupParams_Internal.h" + NS_ASSUME_NONNULL_BEGIN @interface MTRDeviceController_Concrete : MTRDeviceController +/** + * Init a newly created controller. + * + * Only MTRDeviceControllerFactory should be calling this. + */ +- (nullable instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory + queue:(dispatch_queue_t)queue + storageDelegate:(id _Nullable)storageDelegate + storageDelegateQueue:(dispatch_queue_t _Nullable)storageDelegateQueue + otaProviderDelegate:(id _Nullable)otaProviderDelegate + otaProviderDelegateQueue:(dispatch_queue_t _Nullable)otaProviderDelegateQueue + uniqueIdentifier:(NSUUID *)uniqueIdentifier + concurrentSubscriptionPoolSize:(NSUInteger)concurrentSubscriptionPoolSize + storageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration *)storageBehaviorConfiguration + startSuspended:(BOOL)startSuspended; + +/** + * Start a new controller. Returns whether startup succeeded. If this fails, + * it guarantees that it has called controllerShuttingDown on the + * MTRDeviceControllerFactory. + * + * The return value will always match [controller isRunning] for this + * controller. + * + * Only MTRDeviceControllerFactory should be calling this. + */ +- (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams; + /** * Takes an assertion to keep the controller running. If `-[MTRDeviceController shutdown]` is called while an assertion * is held, the shutdown will be honored only after all assertions are released. Invoking this method multiple times increases diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index 8784b61d63cb88..0c768b2ece0671 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -163,16 +163,16 @@ - (nullable instancetype)initWithParameters:(MTRDeviceControllerAbstractParamete return controller; } -- (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory - queue:(dispatch_queue_t)queue - storageDelegate:(id _Nullable)storageDelegate - storageDelegateQueue:(dispatch_queue_t _Nullable)storageDelegateQueue - otaProviderDelegate:(id _Nullable)otaProviderDelegate - otaProviderDelegateQueue:(dispatch_queue_t _Nullable)otaProviderDelegateQueue - uniqueIdentifier:(NSUUID *)uniqueIdentifier - concurrentSubscriptionPoolSize:(NSUInteger)concurrentSubscriptionPoolSize - storageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration *)storageBehaviorConfiguration - startSuspended:(BOOL)startSuspended +- (nullable instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory + queue:(dispatch_queue_t)queue + storageDelegate:(id _Nullable)storageDelegate + storageDelegateQueue:(dispatch_queue_t _Nullable)storageDelegateQueue + otaProviderDelegate:(id _Nullable)otaProviderDelegate + otaProviderDelegateQueue:(dispatch_queue_t _Nullable)otaProviderDelegateQueue + uniqueIdentifier:(NSUUID *)uniqueIdentifier + concurrentSubscriptionPoolSize:(NSUInteger)concurrentSubscriptionPoolSize + storageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration *)storageBehaviorConfiguration + startSuspended:(BOOL)startSuspended { if (self = [super initForSubclasses:startSuspended]) { // Make sure our storage is all set up to work as early as possible, diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index 8eb21aef64eb9e..d57a6e88a48d09 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -40,13 +40,11 @@ #import #import -#import #import #import #import @class MTRDeviceControllerParameters; -@class MTRDeviceControllerStartupParamsInternal; @class MTRDeviceControllerFactory; @class MTRDevice; @class MTRAsyncWorkQueue; @@ -79,18 +77,6 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - MTRDeviceControllerFactory methods -/** - * Start a new controller. Returns whether startup succeeded. If this fails, - * it guarantees that it has called controllerShuttingDown on the - * MTRDeviceControllerFactory. - * - * The return value will always match [controller isRunning] for this - * controller. - * - * Only MTRDeviceControllerFactory should be calling this. - */ -- (BOOL)startup:(MTRDeviceControllerStartupParamsInternal *)startupParams; - /** * Will return chip::kUndefinedFabricIndex if we do not have a fabric index. */ @@ -135,22 +121,6 @@ NS_ASSUME_NONNULL_BEGIN */ @property (nonatomic, retain, nullable) NSData * rootPublicKey; -/** - * Init a newly created controller. - * - * Only MTRDeviceControllerFactory should be calling this. - */ -- (instancetype)initWithFactory:(MTRDeviceControllerFactory *)factory - queue:(dispatch_queue_t)queue - storageDelegate:(id _Nullable)storageDelegate - storageDelegateQueue:(dispatch_queue_t _Nullable)storageDelegateQueue - otaProviderDelegate:(id _Nullable)otaProviderDelegate - otaProviderDelegateQueue:(dispatch_queue_t _Nullable)otaProviderDelegateQueue - uniqueIdentifier:(NSUUID *)uniqueIdentifier - concurrentSubscriptionPoolSize:(NSUInteger)concurrentSubscriptionPoolSize - storageBehaviorConfiguration:(MTRDeviceStorageBehaviorConfiguration *)storageBehaviorConfiguration - startSuspended:(BOOL)startSuspended; - /** * Check whether this controller is running on the given fabric, as represented * by the provided FabricTable and fabric index. The provided fabric table may From d3428a1397e559c7048fcb593ed0b2d08040f656 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 19 Sep 2024 22:46:43 -0400 Subject: [PATCH 40/47] Mark setupDeviceForNodeID: on MTRDeviceController as abstract. (#35679) This is overridden by the XPC and Concrete implementations. Also, there is no need to override deviceForNodeID and removeDevice in MTRDeviceController_Concrete, so those overrides are removed. --- .../Framework/CHIP/MTRDeviceController.mm | 38 +------------------ .../CHIP/MTRDeviceControllerParameters.h | 2 +- .../CHIP/MTRDeviceController_Concrete.mm | 24 ------------ .../CHIP/MTRDeviceController_Internal.h | 4 ++ 4 files changed, 7 insertions(+), 61 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController.mm b/src/darwin/Framework/CHIP/MTRDeviceController.mm index aaf1289f184f98..b8e454b49080c3 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController.mm @@ -780,44 +780,10 @@ - (MTRBaseDevice *)baseDeviceForNodeID:(NSNumber *)nodeID return [[MTRBaseDevice alloc] initWithNodeID:nodeID controller:self]; } -// If prefetchedClusterData is not provided, load attributes individually from controller data store - (MTRDevice *)_setupDeviceForNodeID:(NSNumber *)nodeID prefetchedClusterData:(NSDictionary *)prefetchedClusterData { - os_unfair_lock_assert_owner(self.deviceMapLock); - - MTRDevice * deviceToReturn = [[MTRDevice_Concrete alloc] initWithNodeID:nodeID controller:self]; - // If we're not running, don't add the device to our map. That would - // create a cycle that nothing would break. Just return the device, - // which will be in exactly the state it would be in if it were created - // while we were running and then we got shut down. - if ([self isRunning]) { - [_nodeIDToDeviceMap setObject:deviceToReturn forKey:nodeID]; - } - - if (prefetchedClusterData) { - if (prefetchedClusterData.count) { - [deviceToReturn setPersistedClusterData:prefetchedClusterData]; - } - } else if (_controllerDataStore) { - // Load persisted cluster data if they exist. - NSDictionary * clusterData = [_controllerDataStore getStoredClusterDataForNodeID:nodeID]; - MTR_LOG("%@ Loaded %lu cluster data from storage for %@", self, static_cast(clusterData.count), deviceToReturn); - if (clusterData.count) { - [deviceToReturn setPersistedClusterData:clusterData]; - } - } - - // TODO: Figure out how to get the device data as part of our bulk-read bits. - if (_controllerDataStore) { - auto * deviceData = [_controllerDataStore getStoredDeviceDataForNodeID:nodeID]; - if (deviceData.count) { - [deviceToReturn setPersistedDeviceData:deviceData]; - } - } - - [deviceToReturn setStorageBehaviorConfiguration:_storageBehaviorConfiguration]; - - return deviceToReturn; + MTR_ABSTRACT_METHOD(); + return nil; } - (MTRDevice *)deviceForNodeID:(NSNumber *)nodeID diff --git a/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h index 171c91c889a493..c18a49ba3aaba6 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h +++ b/src/darwin/Framework/CHIP/MTRDeviceControllerParameters.h @@ -166,7 +166,7 @@ MTR_NEWLY_AVAILABLE /** * A controller created from this way will connect to a remote instance of an MTRDeviceController loaded in an XPC Service * - * @param xpcConnectionBlock The XPC Connection block that will return an NSXPCConnection to the indended listener. + * @param xpcConnectionBlock The XPC Connection block that will return an NSXPCConnection to the intended listener. * * @param uniqueIdentifier The unique id to assign to the controller. * diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm index 0c768b2ece0671..1ddc43f488ab11 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.mm @@ -1193,30 +1193,6 @@ - (MTRDevice *)_setupDeviceForNodeID:(NSNumber *)nodeID prefetchedClusterData:(N return deviceToReturn; } -- (MTRDevice *)deviceForNodeID:(NSNumber *)nodeID -{ - std::lock_guard lock(*self.deviceMapLock); - MTRDevice * deviceToReturn = [self.nodeIDToDeviceMap objectForKey:nodeID]; - if (!deviceToReturn) { - deviceToReturn = [self _setupDeviceForNodeID:nodeID prefetchedClusterData:nil]; - } - - return deviceToReturn; -} - -- (void)removeDevice:(MTRDevice *)device -{ - std::lock_guard lock(*self.deviceMapLock); - auto * nodeID = device.nodeID; - MTRDevice * deviceToRemove = [self.nodeIDToDeviceMap objectForKey:nodeID]; - if (deviceToRemove == device) { - [deviceToRemove invalidate]; - [self.nodeIDToDeviceMap removeObjectForKey:nodeID]; - } else { - MTR_LOG_ERROR("%@ Error: Cannot remove device %p with nodeID %llu", self, device, nodeID.unsignedLongLongValue); - } -} - #ifdef DEBUG - (NSDictionary *)unitTestGetDeviceAttributeCounts { diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h index d57a6e88a48d09..bcdcb70d10cfc2 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Internal.h @@ -268,6 +268,10 @@ NS_ASSUME_NONNULL_BEGIN #pragma mark - Device-specific data and SDK access // DeviceController will act as a central repository for this opaque dictionary that MTRDevice manages - (MTRDevice *)deviceForNodeID:(NSNumber *)nodeID; +/** + * _setupDeviceForNodeID is a hook expected to be implemented by subclasses to + * actually allocate a device object of the right type. + */ - (MTRDevice *)_setupDeviceForNodeID:(NSNumber *)nodeID prefetchedClusterData:(nullable NSDictionary *)prefetchedClusterData; - (void)removeDevice:(MTRDevice *)device; From 56c0bd8cebb2be61ab0a823deed6600d22831af7 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Fri, 20 Sep 2024 05:30:19 +0200 Subject: [PATCH 41/47] [Fabric-Sync] Run MCORE-FS-1.3 and MCORE-FS-1.4 on CI (#35402) * [Fabric-Sync] Run MCORE-FS-1.3 and MCORE-FS-1.4 on CI * Adopt TC_MCORE_FS_1_1 to run in CI * Reuse AppServer from TC_MCORE_FS_1_1 * Fix typo * Reuse AppServer from TC_MCORE_FS_1_1 * Restyled by isort * Fix TH server app name * Add json and perfetto tracing * Do not exit fabric-sync-app before apps are terminated * Wait for process termination * Turn off verbose output --------- Co-authored-by: Restyled.io --- .../fabric-admin/scripts/fabric-sync-app.py | 55 ++++----- src/python_testing/TC_MCORE_FS_1_1.py | 104 ++++++++++++------ src/python_testing/TC_MCORE_FS_1_2.py | 83 +++++++------- src/python_testing/TC_MCORE_FS_1_3.py | 27 +---- src/python_testing/TC_MCORE_FS_1_4.py | 62 ++++------- src/python_testing/TC_MCORE_FS_1_5.py | 84 +++++++------- src/python_testing/execute_python_tests.py | 3 - .../chip/testing/tasks.py | 7 +- 8 files changed, 209 insertions(+), 216 deletions(-) diff --git a/examples/fabric-admin/scripts/fabric-sync-app.py b/examples/fabric-admin/scripts/fabric-sync-app.py index 3967f97478940e..797a08a9451047 100755 --- a/examples/fabric-admin/scripts/fabric-sync-app.py +++ b/examples/fabric-admin/scripts/fabric-sync-app.py @@ -31,10 +31,7 @@ async def forward_f(prefix: bytes, f_in: asyncio.StreamReader, This function can optionally feed received lines to a callback function. """ - while True: - line = await f_in.readline() - if not line: - break + while line := await f_in.readline(): if cb is not None: cb(line) f_out.buffer.write(prefix) @@ -68,11 +65,7 @@ async def forward_stdin(f_out: asyncio.StreamWriter): reader = asyncio.StreamReader() protocol = asyncio.StreamReaderProtocol(reader) await loop.connect_read_pipe(lambda: protocol, sys.stdin) - while True: - line = await reader.readline() - if not line: - # Exit on Ctrl-D (EOF). - sys.exit(0) + while line := await reader.readline(): f_out.write(line) await f_out.drain() @@ -206,12 +199,16 @@ async def main(args): passcode=args.passcode, )) + loop = asyncio.get_event_loop() + def terminate(): - admin.terminate() - bridge.terminate() - sys.exit(0) + with contextlib.suppress(ProcessLookupError): + admin.terminate() + with contextlib.suppress(ProcessLookupError): + bridge.terminate() + loop.remove_signal_handler(signal.SIGINT) + loop.remove_signal_handler(signal.SIGTERM) - loop = asyncio.get_event_loop() loop.add_signal_handler(signal.SIGINT, terminate) loop.add_signal_handler(signal.SIGTERM, terminate) @@ -238,7 +235,8 @@ def terminate(): cmd, # Wait for the log message indicating that the bridge has been # added to the fabric. - f"Commissioning complete for node ID {bridge_node_id:#018x}: success") + f"Commissioning complete for node ID {bridge_node_id:#018x}: success", + timeout=30) # Open commissioning window with original setup code for the bridge. cw_endpoint_id = 0 @@ -250,18 +248,23 @@ def terminate(): f" {cw_option} {cw_timeout} {cw_iteration} {cw_discriminator}") try: - await asyncio.gather( - forward_pipe(pipe, admin.p.stdin) if pipe else forward_stdin(admin.p.stdin), - admin.wait(), - bridge.wait(), - ) - except SystemExit: - admin.terminate() - bridge.terminate() - except Exception: - admin.terminate() - bridge.terminate() - raise + forward = forward_pipe(pipe, admin.p.stdin) if pipe else forward_stdin(admin.p.stdin) + # Wait for any of the tasks to complete. + _, pending = await asyncio.wait([ + asyncio.create_task(admin.wait()), + asyncio.create_task(bridge.wait()), + asyncio.create_task(forward), + ], return_when=asyncio.FIRST_COMPLETED) + # Cancel the remaining tasks. + for task in pending: + task.cancel() + except Exception as e: + print(e, file=sys.stderr) + + terminate() + # Make sure that we will not return until both processes are terminated. + await admin.wait() + await bridge.wait() if __name__ == "__main__": diff --git a/src/python_testing/TC_MCORE_FS_1_1.py b/src/python_testing/TC_MCORE_FS_1_1.py index 4ea9d362655884..0d77bad8c6f268 100755 --- a/src/python_testing/TC_MCORE_FS_1_1.py +++ b/src/python_testing/TC_MCORE_FS_1_1.py @@ -17,44 +17,83 @@ # This test requires a TH_SERVER application. Please specify with --string-arg th_server_app_path: +# See https://github.com/project-chip/connectedhomeip/blob/master/docs/testing/python.md#defining-the-ci-test-arguments +# for details about the block below. +# +# === BEGIN CI TEST ARGUMENTS === +# test-runner-runs: run1 +# test-runner-run/run1/app: examples/fabric-admin/scripts/fabric-sync-app.py +# test-runner-run/run1/app-args: --app-admin=${FABRIC_ADMIN_APP} --app-bridge=${FABRIC_BRIDGE_APP} --stdin-pipe=dut-fsa-stdin --discriminator=1234 +# test-runner-run/run1/factoryreset: true +# test-runner-run/run1/script-args: --PICS src/app/tests/suites/certification/ci-pics-values --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --string-arg th_server_app_path:${ALL_CLUSTERS_APP} --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto +# test-runner-run/run1/script-start-delay: 5 +# test-runner-run/run1/quiet: true +# === END CI TEST ARGUMENTS === + import logging import os import random -import signal -import subprocess +import tempfile import time -import uuid import chip.clusters as Clusters from chip import ChipDeviceCtrl +from chip.testing.tasks import Subprocess from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main from mobly import asserts +class AppServer(Subprocess): + """Wrapper class for starting an application server in a subprocess.""" + + # Prefix for log messages from the application server. + PREFIX = "[SERVER]" + + def __init__(self, app: str, storage_dir: str, discriminator: int, passcode: int, port: int = 5540): + storage_kvs_dir = tempfile.mkstemp(dir=storage_dir, prefix="kvs-app-")[1] + # Start the server application with dedicated KVS storage. + super().__init__(app, "--KVS", storage_kvs_dir, + '--secured-device-port', str(port), + "--discriminator", str(discriminator), + "--passcode", str(passcode), + prefix=self.PREFIX) + + def start(self): + # Start process and block until it prints the expected output. + super().start(expected_output="Server initialization complete") + + class TC_MCORE_FS_1_1(MatterBaseTest): @async_test_body async def setup_class(self): super().setup_class() - self.app_process = None - app = self.user_params.get("th_server_app_path", None) - if not app: - asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:') - - self.kvs = f'kvs_{str(uuid.uuid4())}' - self.port = 5543 - discriminator = random.randint(0, 4095) - passcode = 20202021 - cmd = [app] - cmd.extend(['--secured-device-port', str(5543)]) - cmd.extend(['--discriminator', str(discriminator)]) - cmd.extend(['--passcode', str(passcode)]) - cmd.extend(['--KVS', self.kvs]) - # TODO: Determine if we want these logs cooked or pushed to somewhere else - logging.info("Starting application to acts mock a server portion of TH_FSA") - self.app_process = subprocess.Popen(cmd) - logging.info("Started application to acts mock a server portion of TH_FSA") - time.sleep(3) + + self.th_server = None + self.storage = None + + th_server_app = self.user_params.get("th_server_app_path", None) + if not th_server_app: + asserts.fail("This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:") + if not os.path.exists(th_server_app): + asserts.fail(f"The path {th_server_app} does not exist") + + # Create a temporary storage directory for keeping KVS files. + self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__) + logging.info("Temporary storage directory: %s", self.storage.name) + + self.th_server_port = 5543 + self.th_server_discriminator = random.randint(0, 4095) + self.th_server_passcode = 20202021 + + # Start the TH_SERVER_NO_UID app. + self.th_server = AppServer( + th_server_app, + storage_dir=self.storage.name, + port=self.th_server_port, + discriminator=self.th_server_discriminator, + passcode=self.th_server_passcode) + self.th_server.start() logging.info("Commissioning from separate fabric") # Create a second controller on a new fabric to communicate to the server @@ -63,25 +102,24 @@ async def setup_class(self): paa_path = str(self.matter_test_config.paa_trust_store_path) self.TH_server_controller = new_fabric_admin.NewController(nodeId=112233, paaTrustStorePath=paa_path) self.server_nodeid = 1111 - await self.TH_server_controller.CommissionOnNetwork(nodeId=self.server_nodeid, setupPinCode=passcode, filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, filter=discriminator) + await self.TH_server_controller.CommissionOnNetwork( + nodeId=self.server_nodeid, + setupPinCode=self.th_server_passcode, + filterType=ChipDeviceCtrl.DiscoveryFilterType.LONG_DISCRIMINATOR, + filter=self.th_server_discriminator) logging.info("Commissioning TH_SERVER complete") def teardown_class(self): - # In case the th_server_app_path does not exist, then we failed the test - # and there is nothing to remove - if self.app_process is not None: - logging.warning("Stopping app with SIGTERM") - self.app_process.send_signal(signal.SIGTERM.value) - self.app_process.wait() - - if os.path.exists(self.kvs): - os.remove(self.kvs) + if self.th_server is not None: + self.th_server.terminate() + if self.storage is not None: + self.storage.cleanup() super().teardown_class() def steps_TC_MCORE_FS_1_1(self) -> list[TestStep]: steps = [TestStep(1, "Enable Fabric Synchronization on DUT_FSA using the manufacturer specified mechanism.", is_commissioning=True), TestStep(2, "Commission DUT_FSA onto TH_FSA fabric."), - TestStep(3, "Reverse Commision Commission TH_FSAs onto DUT_FSA fabric."), + TestStep(3, "Reverse Commission TH_FSAs onto DUT_FSA fabric."), TestStep("3a", "TH_FSA sends RequestCommissioningApproval"), TestStep("3b", "TH_FSA sends CommissionNode"), TestStep("3c", "DUT_FSA commissions TH_FSA")] diff --git a/src/python_testing/TC_MCORE_FS_1_2.py b/src/python_testing/TC_MCORE_FS_1_2.py index b18dcc5b42ef64..3c155e9d188334 100644 --- a/src/python_testing/TC_MCORE_FS_1_2.py +++ b/src/python_testing/TC_MCORE_FS_1_2.py @@ -24,11 +24,9 @@ import os import queue import secrets -import signal import struct -import subprocess +import tempfile import time -import uuid from dataclasses import dataclass import chip.clusters as Clusters @@ -36,6 +34,7 @@ from ecdsa.curves import NIST256p from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts +from TC_MCORE_FS_1_1 import AppServer from TC_SC_3_6 import AttributeChangeAccumulator # Length of `w0s` and `w1s` elements @@ -52,7 +51,7 @@ def _generate_verifier(passcode: int, salt: bytes, iterations: int) -> bytes: @dataclass -class _SetupParamters: +class _SetupParameters: setup_qr_code: str manual_code: int discriminator: int @@ -63,45 +62,49 @@ class TC_MCORE_FS_1_2(MatterBaseTest): @async_test_body async def setup_class(self): super().setup_class() + self._partslist_subscription = None - self._app_th_server_process = None - self._th_server_kvs = None + self.th_server = None + self.storage = None + + th_server_port = self.user_params.get("th_server_port", 5543) + th_server_app = self.user_params.get("th_server_app_path", None) + if not th_server_app: + asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:') + if not os.path.exists(th_server_app): + asserts.fail(f'The path {th_server_app} does not exist') + + # Create a temporary storage directory for keeping KVS files. + self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__) + logging.info("Temporary storage directory: %s", self.storage.name) + + self.th_server_port = th_server_port + self.th_server_setup_params = _SetupParameters( + setup_qr_code="MT:-24J0AFN00KA0648G00", + manual_code=34970112332, + discriminator=3840, + passcode=20202021) + + # Start the TH_SERVER_NO_UID app. + self.th_server = AppServer( + th_server_app, + storage_dir=self.storage.name, + port=self.th_server_port, + discriminator=self.th_server_setup_params.discriminator, + passcode=self.th_server_setup_params.passcode) + self.th_server.start() def teardown_class(self): if self._partslist_subscription is not None: self._partslist_subscription.Shutdown() self._partslist_subscription = None - - if self._app_th_server_process is not None: - logging.warning("Stopping app with SIGTERM") - self._app_th_server_process.send_signal(signal.SIGTERM.value) - self._app_th_server_process.wait() - - if self._th_server_kvs is not None: - os.remove(self._th_server_kvs) + if self.th_server is not None: + self.th_server.terminate() + if self.storage is not None: + self.storage.cleanup() super().teardown_class() - async def _create_th_server(self, port): - # These are default testing values - setup_params = _SetupParamters(setup_qr_code="MT:-24J0AFN00KA0648G00", - manual_code=34970112332, discriminator=3840, passcode=20202021) - kvs = f'kvs_{str(uuid.uuid4())}' - - cmd = [self._th_server_app_path] - cmd.extend(['--secured-device-port', str(port)]) - cmd.extend(['--discriminator', str(setup_params.discriminator)]) - cmd.extend(['--passcode', str(setup_params.passcode)]) - cmd.extend(['--KVS', kvs]) - - # TODO: Determine if we want these logs cooked or pushed to somewhere else - logging.info("Starting TH_SERVER") - self._app_th_server_process = subprocess.Popen(cmd) - self._th_server_kvs = kvs - logging.info("Started TH_SERVER") - time.sleep(3) - return setup_params - - def _ask_for_vendor_commissioning_ux_operation(self, setup_params: _SetupParamters): + def _ask_for_vendor_commissioning_ux_operation(self, setup_params: _SetupParameters): self.wait_for_user_input( prompt_msg=f"Using the DUT vendor's provided interface, commission the ICD device using the following parameters:\n" f"- discriminator: {setup_params.discriminator}\n" @@ -115,7 +118,6 @@ def steps_TC_MCORE_FS_1_2(self) -> list[TestStep]: steps = [TestStep(1, "TH subscribes to PartsList attribute of the Descriptor cluster of DUT_FSA endpoint 0."), TestStep(2, "Follow manufacturer provided instructions to have DUT_FSA commission TH_SERVER"), TestStep(3, "TH waits up to 30 seconds for subscription report from the PartsList attribute of the Descriptor to contain new endpoint"), - TestStep(4, "TH uses DUT to open commissioning window to TH_SERVER"), TestStep(5, "TH commissions TH_SERVER"), TestStep(6, "TH reads all attributes in Basic Information cluster from TH_SERVER directly"), @@ -134,12 +136,6 @@ async def test_TC_MCORE_FS_1_2(self): min_report_interval_sec = self.user_params.get("min_report_interval_sec", 0) max_report_interval_sec = self.user_params.get("max_report_interval_sec", 30) - th_server_port = self.user_params.get("th_server_port", 5543) - self._th_server_app_path = self.user_params.get("th_server_app_path", None) - if not self._th_server_app_path: - asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:') - if not os.path.exists(self._th_server_app_path): - asserts.fail(f'The path {self._th_server_app_path} does not exist') self.step(1) # Subscribe to the PartsList @@ -164,8 +160,7 @@ async def test_TC_MCORE_FS_1_2(self): asserts.assert_true(type_matches(step_1_dut_parts_list, list), "PartsList is expected to be a list") self.step(2) - setup_params = await self._create_th_server(th_server_port) - self._ask_for_vendor_commissioning_ux_operation(setup_params) + self._ask_for_vendor_commissioning_ux_operation(self.th_server_setup_params) self.step(3) report_waiting_timeout_delay_sec = 30 diff --git a/src/python_testing/TC_MCORE_FS_1_3.py b/src/python_testing/TC_MCORE_FS_1_3.py index 1270b5682e8ad2..e57487a24966a2 100644 --- a/src/python_testing/TC_MCORE_FS_1_3.py +++ b/src/python_testing/TC_MCORE_FS_1_3.py @@ -26,10 +26,10 @@ # test-runner-runs: run1 # test-runner-run/run1/app: examples/fabric-admin/scripts/fabric-sync-app.py # test-runner-run/run1/app-args: --app-admin=${FABRIC_ADMIN_APP} --app-bridge=${FABRIC_BRIDGE_APP} --stdin-pipe=dut-fsa-stdin --discriminator=1234 -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/script-args: --PICS src/app/tests/suites/certification/ci-pics-values --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --string-arg th_server_no_uid_app_path:${LIGHTING_APP_NO_UNIQUE_ID} +# test-runner-run/run1/factoryreset: true +# test-runner-run/run1/script-args: --PICS src/app/tests/suites/certification/ci-pics-values --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --string-arg th_server_no_uid_app_path:${LIGHTING_APP_NO_UNIQUE_ID} --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # test-runner-run/run1/script-start-delay: 5 -# test-runner-run/run1/quiet: false +# test-runner-run/run1/quiet: true # === END CI TEST ARGUMENTS === import asyncio @@ -41,28 +41,9 @@ import chip.clusters as Clusters from chip import ChipDeviceCtrl from chip.interaction_model import Status -from chip.testing.tasks import Subprocess from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts - - -class AppServer: - - def __init__(self, app, storage_dir, port=None, discriminator=None, passcode=None): - args = [ - "--KVS", tempfile.mkstemp(dir=storage_dir, prefix="kvs-app-")[1], - ] - args.extend(['--secured-device-port', str(port)]) - args.extend(["--discriminator", str(discriminator)]) - args.extend(["--passcode", str(passcode)]) - self.app = Subprocess(app, *args, prefix="[SERVER]") - - def start(self): - # Start process and block until it prints the expected output. - self.app.start(expected_output="Server initialization complete") - - def terminate(self): - self.app.terminate() +from TC_MCORE_FS_1_1 import AppServer class TC_MCORE_FS_1_3(MatterBaseTest): diff --git a/src/python_testing/TC_MCORE_FS_1_4.py b/src/python_testing/TC_MCORE_FS_1_4.py index 7b101bb9273349..d76b0625202e1f 100644 --- a/src/python_testing/TC_MCORE_FS_1_4.py +++ b/src/python_testing/TC_MCORE_FS_1_4.py @@ -26,10 +26,10 @@ # test-runner-runs: run1 # test-runner-run/run1/app: examples/fabric-admin/scripts/fabric-sync-app.py # test-runner-run/run1/app-args: --app-admin=${FABRIC_ADMIN_APP} --app-bridge=${FABRIC_BRIDGE_APP} --stdin-pipe=dut-fsa-stdin --discriminator=1234 -# test-runner-run/run1/factoryreset: True -# test-runner-run/run1/script-args: --PICS src/app/tests/suites/certification/ci-pics-values --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --string-arg th_fsa_app_path:examples/fabric-admin/scripts/fabric-sync-app.py th_fsa_admin_path:${FABRIC_ADMIN_APP} th_fsa_bridge_path:${FABRIC_BRIDGE_APP} th_server_no_uid_app_path:${LIGHTING_APP_NO_UNIQUE_ID} dut_fsa_stdin_pipe:dut-fsa-stdin +# test-runner-run/run1/factoryreset: true +# test-runner-run/run1/script-args: --PICS src/app/tests/suites/certification/ci-pics-values --storage-path admin_storage.json --commissioning-method on-network --discriminator 1234 --passcode 20202021 --string-arg th_fsa_app_path:examples/fabric-admin/scripts/fabric-sync-app.py th_fsa_admin_path:${FABRIC_ADMIN_APP} th_fsa_bridge_path:${FABRIC_BRIDGE_APP} th_server_no_uid_app_path:${LIGHTING_APP_NO_UNIQUE_ID} dut_fsa_stdin_pipe:dut-fsa-stdin --trace-to json:${TRACE_TEST_JSON}.json --trace-to perfetto:${TRACE_TEST_PERFETTO}.perfetto # test-runner-run/run1/script-start-delay: 5 -# test-runner-run/run1/quiet: false +# test-runner-run/run1/quiet: true # === END CI TEST ARGUMENTS === import asyncio @@ -44,14 +44,16 @@ from chip.testing.tasks import Subprocess from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts +from TC_MCORE_FS_1_1 import AppServer -class FabricSyncApp: +class FabricSyncApp(Subprocess): - def __init__(self, fabric_sync_app_path, fabric_admin_app_path, fabric_bridge_app_path, - storage_dir, fabric_name=None, node_id=None, vendor_id=None, - paa_trust_store_path=None, bridge_port=None, bridge_discriminator=None, - bridge_passcode=None): + def __init__(self, fabric_sync_app_path: str, fabric_admin_app_path: str, + fabric_bridge_app_path: str, storage_dir: str, paa_trust_store_path: str = None, + fabric_name: str = None, node_id: int = None, vendor_id: int = None, + bridge_discriminator: int = None, bridge_passcode: int = None, + bridge_port: int = 5540): args = [ f"--app-admin={fabric_admin_app_path}", f"--app-bridge={fabric_bridge_app_path}", @@ -68,45 +70,27 @@ def __init__(self, fabric_sync_app_path, fabric_admin_app_path, fabric_bridge_ap args.append(f"--commissioner-name={fabric_name}") if node_id is not None: args.append(f"--commissioner-node-id={node_id}") - args.append(f"--commissioner-vendor-id={vendor_id}") - args.append(f"--secured-device-port={bridge_port}") - args.append(f"--discriminator={bridge_discriminator}") - args.append(f"--passcode={bridge_passcode}") - - self.fabric_sync_app = Subprocess(fabric_sync_app_path, *args) + if vendor_id is not None: + args.append(f"--commissioner-vendor-id={vendor_id}") + if bridge_port is not None: + args.append(f"--secured-device-port={bridge_port}") + if bridge_discriminator is not None: + args.append(f"--discriminator={bridge_discriminator}") + if bridge_passcode is not None: + args.append(f"--passcode={bridge_passcode}") + # Start the FSA application with dedicated storage and RPC ports. + super().__init__(fabric_sync_app_path, *args) def start(self): # Start process and block until it prints the expected output. - self.fabric_sync_app.start(expected_output="Successfully opened pairing window on the device") - - def terminate(self): - self.fabric_sync_app.terminate() + super().start(expected_output="Successfully opened pairing window on the device") - def commission_on_network(self, node_id, setup_pin_code=None, filter_type=None, filter=None): - self.fabric_sync_app.send( + def commission_on_network(self, node_id: int, setup_pin_code: int, filter_type=None, filter=None): + self.send( f"pairing onnetwork {node_id} {setup_pin_code}", expected_output=f"Commissioning complete for node ID {node_id:#018x}: success") -class AppServer: - - def __init__(self, app, storage_dir, port=None, discriminator=None, passcode=None): - args = [ - "--KVS", tempfile.mkstemp(dir=storage_dir, prefix="kvs-app-")[1], - ] - args.extend(['--secured-device-port', str(port)]) - args.extend(["--discriminator", str(discriminator)]) - args.extend(["--passcode", str(passcode)]) - self.app = Subprocess(app, *args, prefix="[SERVER]") - - def start(self): - # Start process and block until it prints the expected output. - self.app.start(expected_output="Server initialization complete") - - def terminate(self): - self.app.terminate() - - class TC_MCORE_FS_1_4(MatterBaseTest): @property diff --git a/src/python_testing/TC_MCORE_FS_1_5.py b/src/python_testing/TC_MCORE_FS_1_5.py index 22654c994bf41f..2373f66c1cadff 100755 --- a/src/python_testing/TC_MCORE_FS_1_5.py +++ b/src/python_testing/TC_MCORE_FS_1_5.py @@ -22,11 +22,9 @@ import os import queue import secrets -import signal import struct -import subprocess +import tempfile import time -import uuid from dataclasses import dataclass import chip.clusters as Clusters @@ -34,6 +32,7 @@ from ecdsa.curves import NIST256p from matter_testing_support import MatterBaseTest, TestStep, async_test_body, default_matter_test_main, type_matches from mobly import asserts +from TC_MCORE_FS_1_1 import AppServer from TC_SC_3_6 import AttributeChangeAccumulator # Length of `w0s` and `w1s` elements @@ -50,7 +49,7 @@ def _generate_verifier(passcode: int, salt: bytes, iterations: int) -> bytes: @dataclass -class _SetupParamters: +class _SetupParameters: setup_qr_code: str manual_code: int discriminator: int @@ -61,50 +60,54 @@ class TC_MCORE_FS_1_5(MatterBaseTest): @async_test_body async def setup_class(self): super().setup_class() + self._partslist_subscription = None self._cadmin_subscription = None - self._app_th_server_process = None - self._th_server_kvs = None + self.th_server = None + self.storage = None + + th_server_port = self.user_params.get("th_server_port", 5543) + th_server_app = self.user_params.get("th_server_app_path", None) + if not th_server_app: + asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:') + if not os.path.exists(th_server_app): + asserts.fail(f'The path {th_server_app} does not exist') + + # Create a temporary storage directory for keeping KVS files. + self.storage = tempfile.TemporaryDirectory(prefix=self.__class__.__name__) + logging.info("Temporary storage directory: %s", self.storage.name) + + self.th_server_port = th_server_port + # These are default testing values + self.th_server_setup_params = _SetupParameters( + setup_qr_code="MT:-24J0AFN00KA0648G00", + manual_code=34970112332, + discriminator=3840, + passcode=20202021) + + # Start the TH_SERVER_NO_UID app. + self.th_server = AppServer( + th_server_app, + storage_dir=self.storage.name, + port=self.th_server_port, + discriminator=self.th_server_setup_params.discriminator, + passcode=self.th_server_setup_params.passcode) + self.th_server.start() def teardown_class(self): if self._partslist_subscription is not None: self._partslist_subscription.Shutdown() self._partslist_subscription = None - if self._cadmin_subscription is not None: self._cadmin_subscription.Shutdown() self._cadmin_subscription = None - - if self._app_th_server_process is not None: - logging.warning("Stopping app with SIGTERM") - self._app_th_server_process.send_signal(signal.SIGTERM.value) - self._app_th_server_process.wait() - - if self._th_server_kvs is not None: - os.remove(self._th_server_kvs) + if self.th_server is not None: + self.th_server.terminate() + if self.storage is not None: + self.storage.cleanup() super().teardown_class() - async def _create_th_server(self, port): - # These are default testing values - setup_params = _SetupParamters(setup_qr_code="MT:-24J0AFN00KA0648G00", - manual_code=34970112332, discriminator=3840, passcode=20202021) - kvs = f'kvs_{str(uuid.uuid4())}' - - cmd = [self._th_server_app_path] - cmd.extend(['--secured-device-port', str(port)]) - cmd.extend(['--discriminator', str(setup_params.discriminator)]) - cmd.extend(['--passcode', str(setup_params.passcode)]) - cmd.extend(['--KVS', kvs]) - - # TODO: Determine if we want these logs cooked or pushed to somewhere else - logging.info("Starting TH_SERVER") - self._app_th_server_process = subprocess.Popen(cmd) - self._th_server_kvs = kvs - logging.info("Started TH_SERVER") - time.sleep(3) - return setup_params - - def _ask_for_vendor_commissioning_ux_operation(self, setup_params: _SetupParamters): + def _ask_for_vendor_commissioning_ux_operation(self, setup_params: _SetupParameters): self.wait_for_user_input( prompt_msg=f"Using the DUT vendor's provided interface, commission the ICD device using the following parameters:\n" f"- discriminator: {setup_params.discriminator}\n" @@ -139,12 +142,6 @@ async def test_TC_MCORE_FS_1_5(self): min_report_interval_sec = 0 max_report_interval_sec = 30 - th_server_port = self.user_params.get("th_server_port", 5543) - self._th_server_app_path = self.user_params.get("th_server_app_path", None) - if not self._th_server_app_path: - asserts.fail('This test requires a TH_SERVER app. Specify app path with --string-arg th_server_app_path:') - if not os.path.exists(self._th_server_app_path): - asserts.fail(f'The path {self._th_server_app_path} does not exist') self.step(1) # Subscribe to the PartsList @@ -169,8 +166,7 @@ async def test_TC_MCORE_FS_1_5(self): asserts.assert_true(type_matches(step_1_dut_parts_list, list), "PartsList is expected to be a list") self.step(2) - setup_params = await self._create_th_server(th_server_port) - self._ask_for_vendor_commissioning_ux_operation(setup_params) + self._ask_for_vendor_commissioning_ux_operation(self.th_server_setup_params) self.step(3) report_waiting_timeout_delay_sec = 30 diff --git a/src/python_testing/execute_python_tests.py b/src/python_testing/execute_python_tests.py index 1f8621ca2a9b05..f03e31b2e57a50 100644 --- a/src/python_testing/execute_python_tests.py +++ b/src/python_testing/execute_python_tests.py @@ -69,10 +69,7 @@ def main(search_directory, env_file): "TC_OpstateCommon.py", # Shared code for TC_OPSTATE, not a standalone test "TC_pics_checker.py", # Currently isn't enabled because we don't have any examples with conformant PICS "TC_TMP_2_1.py", # src/python_testing/test_testing/test_TC_TMP_2_1.py is the Unit test of this test - "TC_MCORE_FS_1_1.py", # This test requires a TH_SERVER application, hence not ready run with CI "TC_MCORE_FS_1_2.py", # This test requires a TH_SERVER application, hence not ready run with CI - "TC_MCORE_FS_1_3.py", # This test requires a TH_SERVER application, hence not ready run with CI - "TC_MCORE_FS_1_4.py", # This test requires a TH_SERVER application, hence not ready run with CI "TC_MCORE_FS_1_5.py", # This test requires a TH_SERVER application, hence not ready run with CI "TC_OCC_3_1.py", # There are CI issues for the test cases that implements manually controlling sensor device for the occupancy state ON/OFF change "TC_OCC_3_2.py", # There are CI issues for the test cases that implements manually controlling sensor device for the occupancy state ON/OFF change diff --git a/src/python_testing/matter_testing_infrastructure/chip/testing/tasks.py b/src/python_testing/matter_testing_infrastructure/chip/testing/tasks.py index 873cec5e7c234e..a73e73fbeb2bf2 100644 --- a/src/python_testing/matter_testing_infrastructure/chip/testing/tasks.py +++ b/src/python_testing/matter_testing_infrastructure/chip/testing/tasks.py @@ -28,10 +28,7 @@ def forward_f(prefix: bytes, This function can optionally feed received lines to a callback function. """ - while True: - line = f_in.readline() - if not line: - break + while line := f_in.readline(): if cb is not None: cb(line, is_stderr) f_out.buffer.write(prefix) @@ -121,4 +118,6 @@ def send(self, message: str, end: str = "\n", self.expected_output = None def terminate(self): + """Terminate the subprocess and wait for it to finish.""" self.p.terminate() + self.join() From 8f7d74d09c604ef1c8bd98b9f2a3ffc6b21ab1bc Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Fri, 20 Sep 2024 09:26:52 +0200 Subject: [PATCH 42/47] [DNS-SD] Common Resolution Data such as the idle interval, active interval, etc... are ignored by the dnssd platform discovery code when a commissionable node is discovered (#35650) Co-authored-by: Kiel Oleson --- src/lib/dnssd/Discovery_ImplPlatform.cpp | 1 - src/lib/dnssd/TxtFields.cpp | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/dnssd/Discovery_ImplPlatform.cpp b/src/lib/dnssd/Discovery_ImplPlatform.cpp index e214aed4f80da6..54947cd617bf0e 100644 --- a/src/lib/dnssd/Discovery_ImplPlatform.cpp +++ b/src/lib/dnssd/Discovery_ImplPlatform.cpp @@ -409,7 +409,6 @@ void DnssdService::ToDiscoveredCommissionNodeData(const Span & ByteSpan key(reinterpret_cast(mTextEntries[i].mKey), strlen(mTextEntries[i].mKey)); ByteSpan val(mTextEntries[i].mData, mTextEntries[i].mDataSize); FillNodeDataFromTxt(key, val, discoveredData); - FillNodeDataFromTxt(key, val, discoveredData); } } diff --git a/src/lib/dnssd/TxtFields.cpp b/src/lib/dnssd/TxtFields.cpp index 20ca450b8734b5..7e0aca0d9d5049 100644 --- a/src/lib/dnssd/TxtFields.cpp +++ b/src/lib/dnssd/TxtFields.cpp @@ -262,6 +262,7 @@ void FillNodeDataFromTxt(const ByteSpan & key, const ByteSpan & val, CommissionN nodeData.supportsCommissionerGeneratedPasscode = Internal::GetCommissionerPasscode(val); break; default: + FillNodeDataFromTxt(key, val, static_cast(nodeData)); break; } } From b31673fbad1afef66966fc57a0492b94ea171c71 Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Fri, 20 Sep 2024 05:19:57 -0400 Subject: [PATCH 43/47] Fix Darwin build. (#35690) MTRDeviceController_Concrete.h was not including some headers, but this was being covered up until it started being included from a new translation unit that did not happen to get those headers from elsewhere. --- src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h index 615765fc84dae1..14ce0cd0035e03 100644 --- a/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h +++ b/src/darwin/Framework/CHIP/MTRDeviceController_Concrete.h @@ -17,8 +17,7 @@ #import -#import -#import +#import #import "MTRDeviceControllerStartupParams_Internal.h" From 3166e3abf4e8f853baedd7d7df803c22c55a563d Mon Sep 17 00:00:00 2001 From: jamesharrow <93921463+jamesharrow@users.noreply.github.com> Date: Fri, 20 Sep 2024 12:24:11 +0100 Subject: [PATCH 44/47] Fixes #35684 - Corrected conversion from mW to W in TC_DEM_2.1 (#35686) --- src/python_testing/TC_DEM_2_1.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/python_testing/TC_DEM_2_1.py b/src/python_testing/TC_DEM_2_1.py index cbbf7e3783edeb..1cad8aca0c5458 100644 --- a/src/python_testing/TC_DEM_2_1.py +++ b/src/python_testing/TC_DEM_2_1.py @@ -128,7 +128,7 @@ async def test_TC_DEM_2_1(self): asserts.assert_is_instance(abs_min_power, int) if not self.is_ci: - user_response = self.wait_for_user_input(prompt_msg=f"AbsMinPower is {abs_min_power/1000000.0} W - is this correct? Enter 'y' or 'n'", + user_response = self.wait_for_user_input(prompt_msg=f"AbsMinPower is {abs_min_power/1000.0} W - is this correct? Enter 'y' or 'n'", prompt_msg_placeholder="y", default_value="y") asserts.assert_equal(user_response.lower(), "y") @@ -143,7 +143,7 @@ async def test_TC_DEM_2_1(self): asserts.assert_greater_equal(abs_max_power, abs_min_power) if not self.is_ci: - user_response = self.wait_for_user_input(prompt_msg=f"AbsMaxPower is {abs_max_power/1000000.0} W - is this correct? Enter 'y' or 'n'", + user_response = self.wait_for_user_input(prompt_msg=f"AbsMaxPower is {abs_max_power/1000.0} W - is this correct? Enter 'y' or 'n'", prompt_msg_placeholder="y", default_value="y") asserts.assert_equal(user_response.lower(), "y") From 4bdafa289693c736e1b107ef8dc46e106682523b Mon Sep 17 00:00:00 2001 From: Borys Nykytiuk <165832970+BorysNykytiuk@users.noreply.github.com> Date: Fri, 20 Sep 2024 15:33:57 +0300 Subject: [PATCH 45/47] [Telink] Lighting app build with disabled CONFIG_PWM (#35621) * soc: riscv: telink: Lighting app run without CONFIG_PWM Add Dummy backend to the PWM Manager Add option to execute Lightining app with LED Manager Signed-off-by: Borys Nykytiuk * Restyled by whitespace * Restyled by clang-format * Override method linkLed inside lighting app * Restyled by clang-format --------- Signed-off-by: Borys Nykytiuk Co-authored-by: Restyled.io Co-authored-by: Alex Tsitsiura --- examples/lighting-app/telink/CMakeLists.txt | 6 ++- .../lighting-app/telink/include/AppTask.h | 1 + examples/lighting-app/telink/src/AppTask.cpp | 19 ++++++++++ .../telink/common/src/AppTaskCommon.cpp | 8 ++-- .../platform/telink/util/include/PWMManager.h | 22 ++++++++++- .../platform/telink/util/src/PWMManager.cpp | 38 ++++++++++++++++++- 6 files changed, 88 insertions(+), 6 deletions(-) diff --git a/examples/lighting-app/telink/CMakeLists.txt b/examples/lighting-app/telink/CMakeLists.txt index 9e29436a05f5fa..95930946944237 100644 --- a/examples/lighting-app/telink/CMakeLists.txt +++ b/examples/lighting-app/telink/CMakeLists.txt @@ -48,13 +48,17 @@ target_sources(app PRIVATE ${TELINK_COMMON}/zephyr_ext/zephyr_key_matrix.c ${TELINK_COMMON}/zephyr_ext/zephyr_key_pool.c ${TELINK_COMMON}/zephyr_ext/zephyr_led_pool.c - ${TELINK_COMMON}/zephyr_ext/zephyr_pwm_pool.c ${TELINK_COMMON}/zephyr_ext/zephyr_ws2812.c) chip_configure_data_model(app ZAP_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../lighting-common/lighting-app.zap ) +if(CONFIG_PWM) + target_sources(app PRIVATE + ${TELINK_COMMON}/zephyr_ext/zephyr_pwm_pool.c) +endif() + if(CONFIG_BOOTLOADER_MCUBOOT) target_sources(app PRIVATE ${TELINK_COMMON}/util/src/OTAUtil.cpp) endif() diff --git a/examples/lighting-app/telink/include/AppTask.h b/examples/lighting-app/telink/include/AppTask.h index c835c88e097c11..d3327d1ed3f6b8 100644 --- a/examples/lighting-app/telink/include/AppTask.h +++ b/examples/lighting-app/telink/include/AppTask.h @@ -48,6 +48,7 @@ class AppTask : public AppTaskCommon friend class AppTaskCommon; CHIP_ERROR Init(void); + void LinkLeds(LedManager & ledManager); static void LightingActionEventHandler(AppEvent * aEvent); #ifdef CONFIG_CHIP_ENABLE_POWER_ON_FACTORY_RESET diff --git a/examples/lighting-app/telink/src/AppTask.cpp b/examples/lighting-app/telink/src/AppTask.cpp index f250de450def21..63a5cb7d910e0c 100644 --- a/examples/lighting-app/telink/src/AppTask.cpp +++ b/examples/lighting-app/telink/src/AppTask.cpp @@ -20,6 +20,7 @@ #include #include "ColorFormat.h" +#include "LEDManager.h" #include "PWMManager.h" #include @@ -130,16 +131,24 @@ void AppTask::SetInitiateAction(Fixture_Action aAction, int32_t aActor, uint8_t if (aAction == ON_ACTION) { sfixture_on = true; +#ifdef CONFIG_PWM PwmManager::getInstance().setPwm(PwmManager::EAppPwm_Red, (((uint32_t) sLedRgb.r * 1000) / UINT8_MAX)); PwmManager::getInstance().setPwm(PwmManager::EAppPwm_Green, (((uint32_t) sLedRgb.g * 1000) / UINT8_MAX)); PwmManager::getInstance().setPwm(PwmManager::EAppPwm_Blue, (((uint32_t) sLedRgb.b * 1000) / UINT8_MAX)); +#else + LedManager::getInstance().setLed(LedManager::EAppLed_App0, true); +#endif } else { sfixture_on = false; +#ifdef CONFIG_PWM PwmManager::getInstance().setPwm(PwmManager::EAppPwm_Red, false); PwmManager::getInstance().setPwm(PwmManager::EAppPwm_Green, false); PwmManager::getInstance().setPwm(PwmManager::EAppPwm_Blue, false); +#else + LedManager::getInstance().setLed(LedManager::EAppLed_App0, false); +#endif } } else if (aAction == LEVEL_ACTION) @@ -217,6 +226,9 @@ void AppTask::PowerOnFactoryResetEventHandler(AppEvent * aEvent) PwmManager::getInstance().setPwm(PwmManager::EAppPwm_Red, (bool) (sPowerOnFactoryResetTimerCnt % 2)); PwmManager::getInstance().setPwm(PwmManager::EAppPwm_Green, (bool) (sPowerOnFactoryResetTimerCnt % 2)); PwmManager::getInstance().setPwm(PwmManager::EAppPwm_Blue, (bool) (sPowerOnFactoryResetTimerCnt % 2)); +#if !CONFIG_PWM + LedManager::getInstance().setLed(LedManager::EAppLed_App0, (bool) (sPowerOnFactoryResetTimerCnt % 2)); +#endif k_timer_init(&sPowerOnFactoryResetTimer, PowerOnFactoryResetTimerEvent, nullptr); k_timer_start(&sPowerOnFactoryResetTimer, K_MSEC(kPowerOnFactoryResetIndicationTimeMs), K_MSEC(kPowerOnFactoryResetIndicationTimeMs)); @@ -237,3 +249,10 @@ void AppTask::PowerOnFactoryResetTimerEvent(struct k_timer * timer) } } #endif /* CONFIG_CHIP_ENABLE_POWER_ON_FACTORY_RESET */ + +void AppTask::LinkLeds(LedManager & ledManager) +{ +#if (!CONFIG_PWM) + ledManager.linkLed(LedManager::EAppLed_App0, 0); +#endif // !CONFIG_PWM +} diff --git a/examples/platform/telink/common/src/AppTaskCommon.cpp b/examples/platform/telink/common/src/AppTaskCommon.cpp index d2ad2a6fd83a00..8b67c403a8194c 100644 --- a/examples/platform/telink/common/src/AppTaskCommon.cpp +++ b/examples/platform/telink/common/src/AppTaskCommon.cpp @@ -407,9 +407,11 @@ void AppTaskCommon::InitPwms() #if CONFIG_WS2812_STRIP pwmManager.linkBackend(Ws2812Strip::getInstance()); -#else +#elif CONFIG_PWM pwmManager.linkBackend(PwmPool::getInstance()); -#endif // CONFIG_WS2812_STRIP +#else + pwmManager.linkBackend(PwmDummy::getInstance()); +#endif } void AppTaskCommon::LinkPwms(PwmManager & pwmManager) @@ -420,7 +422,7 @@ void AppTaskCommon::LinkPwms(PwmManager & pwmManager) pwmManager.linkPwm(PwmManager::EAppPwm_Red, 0); pwmManager.linkPwm(PwmManager::EAppPwm_Green, 1); pwmManager.linkPwm(PwmManager::EAppPwm_Blue, 2); -#else +#elif CONFIG_PWM pwmManager.linkPwm(PwmManager::EAppPwm_Indication, 0); pwmManager.linkPwm(PwmManager::EAppPwm_Red, 1); pwmManager.linkPwm(PwmManager::EAppPwm_Green, 2); diff --git a/examples/platform/telink/util/include/PWMManager.h b/examples/platform/telink/util/include/PWMManager.h index 852216d08b6d43..717180a9fa4f01 100644 --- a/examples/platform/telink/util/include/PWMManager.h +++ b/examples/platform/telink/util/include/PWMManager.h @@ -130,7 +130,7 @@ class Ws2812Strip : public PwmBackend Ws2812Strip(){}; }; -#else +#elif CONFIG_PWM class PwmPool : public PwmBackend { @@ -150,4 +150,24 @@ class PwmPool : public PwmBackend PwmPool(){}; }; +#else + +class PwmDummy : public PwmBackend +{ +public: + static PwmDummy & getInstance(); + bool linkHW(); + + void setPwmHW(size_t pwm, bool state); + void setPwmHW(size_t pwm, uint32_t permille); + void setPwmHWBlink(size_t pwm, size_t onMs, size_t offMs); + void setPwmHWBreath(size_t pwm, size_t breathMs); + + PwmDummy(PwmDummy const &) = delete; + void operator=(PwmDummy const &) = delete; + +private: + PwmDummy(){}; +}; + #endif // CONFIG_WS2812_STRIP diff --git a/examples/platform/telink/util/src/PWMManager.cpp b/examples/platform/telink/util/src/PWMManager.cpp index 987b66518d44ca..aa747974c93b31 100644 --- a/examples/platform/telink/util/src/PWMManager.cpp +++ b/examples/platform/telink/util/src/PWMManager.cpp @@ -200,7 +200,7 @@ void Ws2812Strip::setPwmHWBreath(size_t pwm, size_t breathMs) LOG_WRN("WS2812 LED setPwmHWBreath not supported"); } -#else +#elif CONFIG_PWM #include @@ -261,4 +261,40 @@ void PwmPool::setPwmHWBreath(size_t pwm, size_t breathMs) } } +#else +// Dummy implementation +PwmDummy & PwmDummy::getInstance() +{ + static PwmDummy instance; + + return instance; +} + +bool PwmDummy::linkHW() +{ + LOG_INF("PWM Dummy inited"); + + return true; +} + +void PwmDummy::setPwmHW(size_t pwm, bool state) +{ + LOG_INF("PWM Dummy %u turn %s", pwm, state ? "on" : "off"); +} + +void PwmDummy::setPwmHW(size_t pwm, uint32_t permille) +{ + LOG_INF("PWM Dummy %u set %u", pwm, permille); +} + +void PwmDummy::setPwmHWBlink(size_t pwm, size_t onMs, size_t offMs) +{ + LOG_WRN("PWM Dummy setPwmHWBlink not supported"); +} + +void PwmDummy::setPwmHWBreath(size_t pwm, size_t breathMs) +{ + LOG_WRN("PWM Dummy setPwmHWBreath not supported"); +} + #endif // CONFIG_WS2812_STRIP From cc29cab4249339af6de6be7019be1e778380ddef Mon Sep 17 00:00:00 2001 From: Rehan Rasool <55205370+rerasool@users.noreply.github.com> Date: Fri, 20 Sep 2024 10:41:53 -0400 Subject: [PATCH 46/47] [Silabs] Update Silabs docker WiseConnect 3.3.2 (#35630) --- integrations/docker/images/base/chip-build/version | 2 +- .../docker/images/stage-2/chip-build-efr32/Dockerfile | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/integrations/docker/images/base/chip-build/version b/integrations/docker/images/base/chip-build/version index 23a501b31c89e6..7947b9eddf4014 100644 --- a/integrations/docker/images/base/chip-build/version +++ b/integrations/docker/images/base/chip-build/version @@ -1 +1 @@ -77 : [NXP] Migrate docker image to NXP Zephyr 3.7 downstream release +78 : [Silabs] Update Silabs docker WiseConnect 3.3.2 diff --git a/integrations/docker/images/stage-2/chip-build-efr32/Dockerfile b/integrations/docker/images/stage-2/chip-build-efr32/Dockerfile index 4de8beb62a81be..d54bab59f0f59e 100644 --- a/integrations/docker/images/stage-2/chip-build-efr32/Dockerfile +++ b/integrations/docker/images/stage-2/chip-build-efr32/Dockerfile @@ -29,8 +29,8 @@ RUN git clone --depth=1 --single-branch --branch=2.10.0 https://github.com/Silic rm -rf .git \ && : # last line -# Clone WiSeConnect SDK v3.3.1 (841ea3f) -RUN git clone --depth=1 --single-branch --branch=v3.3.1 https://github.com/SiliconLabs/wiseconnect.git /tmp/wifi_sdk && \ +# Clone WiSeConnect SDK v3.3.2 (b5d6422) +RUN git clone --depth=1 --single-branch --branch=v3.3.2 https://github.com/SiliconLabs/wiseconnect.git /tmp/wifi_sdk && \ cd /tmp/wifi_sdk && \ rm -rf .git \ && : # last line From 7b8467b5b4bf9709e21b3a9eacf0479358b6b0f9 Mon Sep 17 00:00:00 2001 From: Arkadiusz Bokowy Date: Fri, 20 Sep 2024 16:44:09 +0200 Subject: [PATCH 47/47] [Tizen] Fix ConnectivityManager::GetWiFiBssId implementation (#35694) --- .../Tizen/ConnectivityManagerImpl.cpp | 12 +----- src/platform/Tizen/WiFiManager.cpp | 37 +++++++------------ src/platform/Tizen/WiFiManager.h | 3 +- 3 files changed, 16 insertions(+), 36 deletions(-) diff --git a/src/platform/Tizen/ConnectivityManagerImpl.cpp b/src/platform/Tizen/ConnectivityManagerImpl.cpp index c97196babfbfcf..37a15bb9546c75 100644 --- a/src/platform/Tizen/ConnectivityManagerImpl.cpp +++ b/src/platform/Tizen/ConnectivityManagerImpl.cpp @@ -254,17 +254,7 @@ bool ConnectivityManagerImpl::IsWiFiManagementStarted() CHIP_ERROR ConnectivityManagerImpl::GetWiFiBssId(MutableByteSpan & value) { - constexpr size_t bssIdSize = 6; - VerifyOrReturnError(value.size() >= bssIdSize, CHIP_ERROR_BUFFER_TOO_SMALL); - - uint8_t * bssId = nullptr; - CHIP_ERROR err = Internal::WiFiMgr().GetBssId(bssId); - ReturnErrorOnFailure(err); - - memcpy(value.data(), bssId, bssIdSize); - value.reduce_size(bssIdSize); - - return CHIP_NO_ERROR; + return Internal::WiFiMgr().GetBssId(value); } CHIP_ERROR ConnectivityManagerImpl::GetWiFiSecurityType(SecurityTypeEnum & securityType) diff --git a/src/platform/Tizen/WiFiManager.cpp b/src/platform/Tizen/WiFiManager.cpp index 50e8b9206401d7..0b2cc3cd311f61 100644 --- a/src/platform/Tizen/WiFiManager.cpp +++ b/src/platform/Tizen/WiFiManager.cpp @@ -31,7 +31,9 @@ #include #include #include -#include + +#include "ErrorUtils.h" +#include "NetworkCommissioningDriver.h" using namespace ::chip::DeviceLayer::NetworkCommissioning; @@ -1095,34 +1097,23 @@ CHIP_ERROR WiFiManager::GetConnectionState(wifi_manager_connection_state_e * con return err; } -CHIP_ERROR WiFiManager::GetBssId(uint8_t * bssId) +CHIP_ERROR WiFiManager::GetBssId(MutableByteSpan & value) { - VerifyOrReturnError(bssId != nullptr, CHIP_ERROR_INVALID_ARGUMENT); - - char * bssIdStr = nullptr; - std::unique_ptr _{ bssIdStr, &::free }; + VerifyOrReturnError(value.size() >= kWiFiBSSIDLength, CHIP_ERROR_BUFFER_TOO_SMALL); wifi_manager_ap_h connectedAp = _WiFiGetConnectedAP(); - if (connectedAp == nullptr) - { - return CHIP_ERROR_INCORRECT_STATE; - } + VerifyOrReturnError(connectedAp != nullptr, CHIP_ERROR_INCORRECT_STATE); - int wifiErr = wifi_manager_ap_get_bssid(connectedAp, &bssIdStr); - if (wifiErr != WIFI_MANAGER_ERROR_NONE) - { - ChipLogError(DeviceLayer, "FAIL: get bssid [%s]", get_error_message(wifiErr)); - return CHIP_ERROR_READ_FAILED; - } + GAutoPtr bssIdStr; + int wifiErr = wifi_manager_ap_get_bssid(connectedAp, &bssIdStr.GetReceiver()); + VerifyOrReturnError(wifiErr == WIFI_MANAGER_ERROR_NONE, TizenToChipError(wifiErr), + ChipLogError(DeviceLayer, "FAIL: Get AP BSSID: %s", get_error_message(wifiErr))); - if (sscanf(bssIdStr, "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &mWiFiBSSID[0], &mWiFiBSSID[1], &mWiFiBSSID[2], &mWiFiBSSID[3], - &mWiFiBSSID[4], &mWiFiBSSID[5]) != 6) - { - ChipLogError(DeviceLayer, "FAIL: parse bssid"); - return CHIP_ERROR_READ_FAILED; - } + uint8_t * data = value.data(); + int rv = sscanf(bssIdStr.get(), "%hhx:%hhx:%hhx:%hhx:%hhx:%hhx", &data[0], &data[1], &data[2], &data[3], &data[4], &data[5]); + VerifyOrReturnError(rv == kWiFiBSSIDLength, CHIP_ERROR_READ_FAILED, ChipLogError(DeviceLayer, "FAIL: Parse AP BSSID")); - bssId = mWiFiBSSID; + value.reduce_size(kWiFiBSSIDLength); return CHIP_NO_ERROR; } diff --git a/src/platform/Tizen/WiFiManager.h b/src/platform/Tizen/WiFiManager.h index 8e24b6636763c3..a4dec987ab2e17 100644 --- a/src/platform/Tizen/WiFiManager.h +++ b/src/platform/Tizen/WiFiManager.h @@ -54,7 +54,7 @@ class WiFiManager CHIP_ERROR SetDeviceState(wifi_manager_device_state_e deviceState); CHIP_ERROR GetModuleState(wifi_manager_module_state_e * moduleState); CHIP_ERROR GetConnectionState(wifi_manager_connection_state_e * connectionState); - CHIP_ERROR GetBssId(uint8_t * bssId); + CHIP_ERROR GetBssId(MutableByteSpan & value); CHIP_ERROR GetSecurityType(wifi_manager_security_type_e * securityType); CHIP_ERROR GetConfiguredNetwork(NetworkCommissioning::Network & network); bool IsWiFiStationConnected(); @@ -105,7 +105,6 @@ class WiFiManager wifi_manager_module_state_e mModuleState; wifi_manager_connection_state_e mConnectionState; - uint8_t mWiFiBSSID[kWiFiBSSIDLength]; char mWiFiSSID[kMaxWiFiSSIDLength + 1]; char mWiFiKey[kMaxWiFiKeyLength + 1]; char mInterestedSSID[kMaxWiFiSSIDLength + 1];